datepicker has Today() as value, not the datetime in the fields
datepicker has Today() as value, not the datetime in the fields
My question is two-fold and may have one answer. I got my date fields to sort like I want in the table with moment.js - very cool. But, when I edit one of those values the editor show today's date in YYYY-MM-YYT00:00:00 format and ignore the field's current value
What am I missing? And how can I get just MM/DD/YYYY format of a sql server datetime field? The field is defined as:
{"label": "start_date", "name": "start_date", "type": "datetime" } I have tried adding a "format":"MM/DD/YYYY" which is ignored.
Thanks for any suggestions you might have.
Sean
Answers
The
format: 'MM/DD/YYYY'
should be all that you need. Could you show me an example of the data that is being loaded from the server please?Allan
I have quite the same problem. The datepicker works fine but
defining a datetime field like the following
{ label: "Temps",
name: "ds_datetime",
type: "datetime",
def: function () {
return new Date();
},
format: 'DD-MM-YYYY HH:mm',
keyInput: false,
opts: { minutesIncrement: 5,
momentLocale: 'fr',
},
}
when I edit a ds_datetime field, its current value is ignored and the datepicker is initialized with the current datetime.
I'm wondering what I'm missing ?
Xavier
HI Xavier,
The Moment integration uses strict parsing, which suggests that the data isn't exactly in
DD-MM-YYYY HH:mm
format. Can you give me a link to the page, or show me the data you are loading please?Allan