[CLOSED] [1.0] DateFormat="M$" not working
Hi!
Im trying load a store with json data from a WCF REST-service.
The service sends Microsoft AJAX serialized dates (DateFormat="M$").
Unfortunately Ext.Net translates this to DateFormat="n$" when it renders the page.
The problem is in DateTimeUtils.ConvertNetToPHP where Ext.Net translates .NET dateformats to PHP (M translating to n).
Is it possible to change this behaviour? I've included a small testproject to illustrate the problem.
/Fredrik
RE: [CLOSED] [1.0] DateFormat="M$" not working
Hi,
Thanks for the bug reporting. We should be able fix it soon. I can suggest to use the following workaround
1. Place the following js function to the page
Code:
function parseDate(input) {
var re = new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/');
var r = (input || '').match(re);
return r? new Date(((r[1] || '') + r[2]) * 1) : null;
}
2. Add Convert to the RecordField
Code:
<ext:RecordField Name="Birthday" Type="Date" AllowBlank="false">
<Convert Fn="parseDate" />
</ext:RecordField>
RE: [CLOSED] [1.0] DateFormat="M$" not working
Hi,
Another workaround:
1. Use DateFormat="MMM$"
RE: [CLOSED] [1.0] DateFormat="M$" not working
Hi Fredrik,
A fix has been committed to the Ext.Net.Utilities.DateTimeUtils class to support the "M$" date format.
Revision #2626
RE: [CLOSED] [1.0] DateFormat="M$" not working
Thanks for the quick fix! You have made a couple of guys in Sweden really happy.
/Fredrik