The default ExtJS form.field.date allows manual entry/editing of a date in addition to using the datepicker. However, if you enter a number larger than 31 for the DD or larger than 12 for the MM it recalculates the value.
For example, if the MM/DD/YYYY listed is 12/01/2011 and you edit it to say 15/01/2011 (where the max MM value should be 12), it recalculates to display 03/01/2012 — assuming that you meant to add 3 beyond the max value.
Is there any way to turn off this functionality? I’d like the validation/error message to appear so the user has to manually change rather than have it automatically recalculate. This seems like basic functionality that others would want — am I missing something in the config options?
Cross-posted in the Ext forums.
Adding an answer to my own question found via the ext forum post.
What Ext calls the date “rollover” functionality can be turned off by adding
useStrict: true. See the documentation.I wanted to remove the rollover functionality site-wide, so I added this to our main Ext util.js that is used throughout the site:
As I mentioned in the ext forum, I can’t image why this rollover behavior would be useful to a front-end user — why would someone want to intentionally enter, say, 01/33/2011 and intend to have it result in 02/02/2011.