I have problem with field type="input", inputType="date" and inputType="datetime-local"
This fields save date in format: Fri Nov 30 1973 00:00:00 GMT+0100 (CET)
But cannot read such format. I expects number: 123412323232
Fiddle:
https://jsfiddle.net/ebmgv286/3/
Thanks, missing some formatter from field code
Hot fix: https://jsfiddle.net/icebob/ebmgv286/4/
{
type: "input",
inputType: "date",
label: "Example date",
model: "exampleDate",
set: function(model, val) {
model.exampleDate = new Date(val).valueOf();
}
}
I checked fiddle - now I can save and read dates without errors. Much better :)
Is it possible to save dates in other format? E.g. "2017-03-02 12:04:00"?
If I fixed this bug in vfg then yes.
I fixed it. Fiddle with the fixed bundle: https://jsfiddle.net/ebmgv286/5/
Other example with formatted date value: https://jsfiddle.net/ebmgv286/6/
Does this require any docs changes?
@dflock Maybe. Because now type="input" field have a "format" property if the inputType is date, 藳datetime or datetime-local
Hot fix: https://jsfiddle.net/icebob/ebmgv286/4/
{ type: "input", inputType: "date", label: "Example date", model: "exampleDate", set: function(model, val) { model.exampleDate = new Date(val).valueOf(); } }This work for me. Thanks!
Most helpful comment
Hot fix: https://jsfiddle.net/icebob/ebmgv286/4/