-
31 Jan 2013 10:13 PM #1
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
- Chrome
- IE9
- <!DOCTYPE html>
- A date string is incorrectly parsed upon some conditions:
- Format - "m/Y"
- Current OS date - 29-31 January inclusive
- Parsed date - some from February
- The date is parsed as "03/2013"
- Set up the current OS date to some from 29-31 January inclusive.
- Select some February date in the field
- Blur the field
- "02/2013"
- "03/2013"
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>
-
1 Feb 2013 4:18 AM #2
-
3 Feb 2013 10:42 PM #3
-
11 Feb 2013 12:02 AM #4
-
12 Feb 2013 12:02 AM #5Sencha - Community Support Team
- Join Date
- Nov 2007
- Location
- Helsingborg, Sweden
- Posts
- 2,489
- Vote Rating
- 56
Well, possibly yes. It would make sense for
To produce consistent result regardless of the current date. We'll have to wait for the Ext devs to chime in.Code:Ext.Date.format(new Date(), 'M Y')
-
5 Mar 2013 10:57 PM #6
-
9 Mar 2013 6:10 PM #7
So that should create time 00:00:00 on the 1st of that month?
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
9 Mar 2013 6:42 PM #8
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.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
11 Mar 2013 7:27 AM #9
-
11 Mar 2013 8:05 AM #10
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.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-9049
in
4.2.1.


Reply With Quote