PDA

View Full Version : [CLOSED] problem with DateField



masa2
14 Apr 2007, 1:10 AM
Hi,
I think there still is a problem with the form.DateField widget.
If I set the DateField by:


var df = new Ext.form.DateField({format: 'Y-m-d',minValue: '2000-01-01',
value: new Date()});
var date = new Date();
date.setFullYear(2007);
date.setDate(31);
date.setMonth(2);
df.setValue(date);
the widget shows 2007-03-01.

Marko

The reason for the problem is that the Date object is initialised with today's date April the 14th.
If the "April-Date-object" is set to 31 the day value is set to the 1st of the next month (May) automatically.

brian.moeskau
23 Oct 2007, 3:11 AM
If the auto-correction behavior is not desirable, there is a patch for DateField that might help:

http://extjs.com/forum/showthread.php?p=76950#post76950

mystix
2 Nov 2007, 9:31 AM
just FYI, this isn't an Ext bug -- it's an "autocorrection" feature (mentioned by brian above) built into all JS Date objects.