crbaker
22 May 2008, 11:00 PM
Hi,
I am using a DateField for date inputs and using the format 'Y-m-d', however when the user supplies a date like this one:
2008-15-15 (note: invalid months)
the DateField automatically corrects the date to: 2009-03-15.
It appears (in this case) to be adding 15 months onto 2008 - brining the result up to March the following year.
This 'feature' is part of the ExtJs Date class as when constructing a new Date class as below:
var dt = new Date('15/15/2008 00:00:00 PM GMT-0600'); // note again the invalid months
the new variable (dt) now has a date of March 15th 2009! - It should throw an invalid date exception.
Is there any way to stop this 'auto-correction' from happening?
Thanks.
I am using a DateField for date inputs and using the format 'Y-m-d', however when the user supplies a date like this one:
2008-15-15 (note: invalid months)
the DateField automatically corrects the date to: 2009-03-15.
It appears (in this case) to be adding 15 months onto 2008 - brining the result up to March the following year.
This 'feature' is part of the ExtJs Date class as when constructing a new Date class as below:
var dt = new Date('15/15/2008 00:00:00 PM GMT-0600'); // note again the invalid months
the new variable (dt) now has a date of March 15th 2009! - It should throw an invalid date exception.
Is there any way to stop this 'auto-correction' from happening?
Thanks.