I have a datepicker in my form and it gets the value from the form.load in JSON format.
Which values does the datepicker support?
Because it won’t bind this value:\/Date(1241215200000)\/.
I already have a convert function for the JSON format but I can’t configure the field with a convert or renderer config.
convertDate = function (value) {
if (value == null) return null;
return new Date(parseInt(value.replace("/Date(", ""), 10));
};
The value have to be a valid JavaScript date or
Ext.Date. So you should bind it likeFor example the Newtonsoft JSON serializer is capable of returning this for a given date. But if all fails you may consider overriding the
setValue()of the picker and apply your converter thereBelow is only valid for
Ext.field.Date(My first but wrong answer for a datepicker)
I recommend you to use the
ISO 8601 dateformat for your dates. With that you need to set the submitFormat to cTools like Newtonsoft.Json support the
ISO 8601 dateout of the box (and since .Net 4.5 release 1 as default).