Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-9049 in a recent build.
  1. #1
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default Date parse issue with "m/Y" format

    Date parse issue with "m/Y" format


    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.2.0 beta 2
    Browser versions tested against:
    • Chrome
    • IE9
    DOCTYPE tested against:
    • <!DOCTYPE html>
    Description:
    • A date string is incorrectly parsed upon some conditions:
    1. Format - "m/Y"
    2. Current OS date - 29-31 January inclusive
    3. Parsed date - some from February
    • The date is parsed as "03/2013"
    Steps to reproduce the problem:
    • Set up the current OS date to some from 29-31 January inclusive.
    • Select some February date in the field
    • Blur the field
    The result that was expected:
    • "02/2013"
    The result that occurs instead:
    • "03/2013"
    Test Case:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <title>Date parser issue m/Y</title>
    
        <link rel="stylesheet" href="../resources/css/ext-all.css" />
        
        <script src="../ext-all-debug.js"></script>
    
        <script>
            Ext.onReady(function () {
                Ext.create("Ext.form.field.Date", {
                    renderTo: Ext.getBody(),
                    format: "m/Y"    
                });
            });
        </script>
    </head>
    <body>
    
    </body>
    </html>
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  2. #2

  3. #3
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Thank you for the answer! I will investigate the thread.

    Just a quick question: do you agree it is a bug and should be fixed?
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  4. #4
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Quote Originally Posted by Daniil View Post
    Thank you for the answer! I will investigate the thread.
    Yes, it looks to be the same issue.

    Could you answer this? Just to know your opinion.
    Quote Originally Posted by Daniil View Post
    Just a quick question: do you agree it is a bug and should be fixed?
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  5. #5
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,804
    Vote Rating
    133
    mankz is a splendid one to behold mankz is a splendid one to behold mankz is a splendid one to behold mankz is a splendid one to behold mankz is a splendid one to behold mankz is a splendid one to behold

      1  

    Default


    Well, possibly yes. It would make sense for

    Code:
    Ext.Date.format(new Date(), 'M Y')
    To produce consistent result regardless of the current date. We'll have to wait for the Ext devs to chime in.

  6. #6
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Bump...

    Could someone from ExtJS team kindly look at this issue?
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  7. #7
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,545
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    So that should create time 00:00:00 on the 1st of that month?

  8. #8
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,545
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    I can't reproduce the OP's problem with latest code.

    I just set my machine's date to 31st March.

    And his code produces "02/2013" when selecting a date in Feb.

  9. #9
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    @Animal, thank you for the answer!

    Quote Originally Posted by Animal View Post
    So that should create time 00:00:00 on the 1st of that month?
    Probably, yes.

    Quote Originally Posted by Animal View Post
    And his code produces "02/2013" when selecting a date in Feb.
    Yes, it produces "02/2013" on selecting a date, but it becomes "03/2013" on bluring.

    Please clarify did you blur the field?
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  10. #10
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,545
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    I did, but I probably had the wrong conditions set up.

    Evan has put in a fix for this.

    When defaulting in a day number when one has not been specified in the string, it minimizes the default day number with <lastDayInCurrentMonth>

    So this one is fixed.