[CLOSED] [1.0] DateFormat="M$" not working

  1. #1

    [CLOSED] [1.0] DateFormat="M$" not working


    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.

  2. #2

    RE: [CLOSED] [1.0] DateFormat="M$" not working


    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
    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
    <ext:RecordField Name="Birthday" Type="Date" AllowBlank="false">
            <Convert Fn="parseDate" />
    Vladimir Shcheglov
    Sr. Developer
  3. #3

    RE: [CLOSED] [1.0] DateFormat="M$" not working


    Another workaround:

    1. Use DateFormat="MMM$"
    Vladimir Shcheglov
    Sr. Developer
  4. #4

    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

    Geoffrey McGill
    Founder & CEO
  5. #5

    RE: [CLOSED] [1.0] DateFormat="M$" not working

    Thanks for the quick fix! You have made a couple of guys in Sweden really happy.

  6. #6

    Which dateformat should I use for my jsonreader? MMM$ or M$?
    I tried both and neither one would work.

    In case it helps, I tried the following for my datecolumn format
    "yyyy-MM-dd" and "MM/dd/yyyy"

    Also will it be able to properly interpret dates prior to 1/1/1970?

  7. #7
    Hi @mkshields9w57,

    Please start a new forum thread.

    If you feel that the threads are related, please feel free to cross link between two.

Similar Threads

  1. [CLOSED] DateField DateFormat "YYYY/MM/DD" SelectedValue
    By pattake in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 02, 2012, 1:19 AM
  2. [CLOSED] Version 1.2 Grid/Store DateFormat
    By ndotis in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Oct 04, 2011, 5:14 PM
  3. [CLOSED] DateFormat on store?
    By Dave.Sanders in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Mar 15, 2011, 12:55 PM
  4. Replies: 2
    Last Post: Jul 08, 2009, 12:37 PM
  5. DateFormat in Grid Problem
    By bruce in forum 1.x Help
    Replies: 1
    Last Post: Mar 19, 2009, 8:47 AM

Posting Permissions