Results 1 to 5 of 5

Thread: [CLOSED]IE Ext.util.Format.date BUG

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Jul 2008
    Location
    Berkeley, CA
    Posts
    33
    Vote Rating
    2
      0  

    Post [CLOSED]IE Ext.util.Format.date BUG

    Can anybody tell my why this:

    Code:
    Ext.util.Format.date('2011-02-22T05:00:00','d-M-Y')
    throws the following error in IE 8

    Error: 'Date.monthNames[...]' is null or not an object

    This works fine in all other browsers.

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,215
    Vote Rating
    1008
      0  

    Default

    Run this in the console:

    Code:
    Date.parse('2011-02-22T05:00:00')
    From the docs:

    The value to format (Strings must conform to the format expected by the javascript Date object's parse() method)
    Seems like IE chokes on that particular format.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha Premium User
    Join Date
    Jul 2008
    Location
    Berkeley, CA
    Posts
    33
    Vote Rating
    2
      0  

    Default

    Hm, so you are saying this is a bug? Seems from the sencha docs that this format should work just fine. I ran

    Code:
    Date.parse('2011-02-22T05:00:00')
    from the console and IE8 is producing NaN

    This is Ext-3.3.1

    Do you have any suggestions to work around this?

    Thanks

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,215
    Vote Rating
    1008
      0  

    Default

    No, it's not a bug, the docs state that the value must be in a format the browser can parse. For whatever reason, IE doesn't support that format.

    You can use:

    Code:
    var d = Date.parseDate('2011-02-22T05:00:00', 'c');
    Ext.util.Format.date(d, 'd-M-Y');
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  5. #5
    Sencha Premium User
    Join Date
    Jul 2008
    Location
    Berkeley, CA
    Posts
    33
    Vote Rating
    2
      1  

    Default

    Right, I ended up using that. Thank you.

    Just curious why would Ext.util.Format.date not utilize Date.parseDate and allow passing a read format? Ext.util.Format.date already attempts that but does not account for the fact that IE is not supporting dash separators for d-m-Y. Same seems to be true for Safari.

    Something like this:

    Code:
            date : function(v, format, readFormat) {
                if (!v) {
                    return "";
                }
                if (!Ext.isDate(v)) {
                    v = Date.parseDate(v, readFormat || "c"); 
                }
                return v.dateFormat(format || "m/d/Y");
            },
    Anyways, thanks again.

Similar Threads

  1. Ext.util.Format.date Problem or Bug
    By Kangulo in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 9 Mar 2010, 5:02 AM
  2. [CLOSED][3.??] Date format bug: d/m/y
    By prigole in forum Ext 3.x: Bugs
    Replies: 4
    Last Post: 4 Jan 2010, 7:46 AM
  3. Replies: 2
    Last Post: 21 Nov 2009, 10:19 PM
  4. (Ext 2.2.x) Ext.util.Format.date bug
    By peacock in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 16 Apr 2009, 7:12 PM
  5. Replies: 2
    Last Post: 23 Mar 2009, 12:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •