-
30 Oct 2008 1:48 PM #1
[2.2] Datefield bug
[2.2] Datefield bug
There seems to be a bug in the datefield. Whenever you set a date format for the field that does not include the day (so for example 'Y-m', the selection of a date in february is transformed into a day in march. So in other words, you cannot enter any date in february of any year.
-
2 Nov 2008 8:35 AM #2
yes.... I also observed a problem with datefiled.
i set the fromat as "W" , to get the week number of the Date , but every time i changed the week number other then the current week Number ... it changed to the back to current week as the datefiled loosed focus....Atta ur Rahman
-
24 Nov 2008 11:13 AM #3
-
26 Nov 2008 9:57 AM #4
Did you also change the "altFormats"? They act as backup for parsing of dates and could create the issues mentioned above if left as the default.
-
26 Nov 2008 10:18 AM #5
Just checked it with format and altFormats both set to 'W/Y' and the problem persists.
After looking at the source of Date.js I found that 'W' isn't set to "contribute to the date calculations". Sadly I have no fix for it, since my own experiments on overriding this function and calculating the date from ISO-Week miserably failed :-)
-
26 Nov 2008 6:24 PM #6
@jack, regarding @seldon's issue, the problem with the datefield is that it stores the string representation (containing incomplete date information) instead of the actual Date object (which correctly encapsulates full date info after parseDate() is called) so a format like 'Y-m', while valid, will result in issues as mentioned by @seldon in post #1 because the day of the month will default to the current day when parsing the stored date string.
a correct implementation IMHO should simply store the Date object as the datefield's underlying value, and format it appropriately for display in the datefield's <input> element (the DateField will likely need to have getValue()/setValue() handling which is similar to the ComboBox's i.e. a separate display value + underlying value)
try for example the following datefield code:
and type in the following date strings (wait till the 30th of November, or adjust your system clock so the current day of month is 30):Code:new Ext.form.DateField({ renderTo: document.body, format: 'Y-m', // display + parse format altFormats: 'Y-m-d|d/m/Y' // acceptable parse formats });
Code:2008-12-31 // date string in Y-m-d format 02/02/2008 // date string in d/m/Y format
Last edited by mystix; 26 Nov 2008 at 6:57 PM. Reason: edit
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
26 Nov 2008 7:55 PM #7
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
27 Nov 2008 3:23 AM #8
-
27 Nov 2008 7:59 AM #9
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
-
27 Nov 2008 8:13 AM #10


Reply With Quote



