-
7 Jan 2013 2:27 AM #1
Unanswered: datefield formate error
Unanswered: datefield formate error
I have a date field in form, but I don't have any formate config but when i type 1/7/13 it give me below error msg.
1/7/13 is not a valid date - it must be in the format m/d/y. But if i check same code with sencha online it works without any issue. What I'm doing wrong ?
Code:{ xtype : 'datefield', fieldLabel : 'Effective Date', name : 'effectiveDate' }
-
7 Jan 2013 3:29 PM #2Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,185
- Vote Rating
- 194
- Answers
- 433
So the live API example here work as expected?
http://docs.sencha.com/ext-js/4-1/#!...orm.field.Date
Have you tried setting the format as shown in the Date Format Examples?
Do any formats work?
Scott.
-
7 Jan 2013 7:42 PM #3
I don't want to define any format as i want to use default format(m/d/y) but default altFormate is getting overridden by local specific file (ext-lang-en.js)
Ref:
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Date-cfg-altFormats
ext-lang-en.js // Extjs file from Sencha
File has one override function to change the altFormats value for english user.
Ext.define("Ext.locale.en.form.field.Date", {
override: "Ext.form.field.Date",
disabledDaysText: "Disabled",
disabledDatesText: "Disabled",
minText: "The date in this field must be after {0}",
maxText: "The date in this field must be before {0}",
invalidText: "{0} is not a valid date - it must be in the format {1}",
format: "m/d/y",
altFormats: "m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d" // different then default value
});
While using the default altFormats provided in the definition of datefield it works fine.
Why for english user default altformat is different ?


Reply With Quote