1. #1
    Sencha Premium Member koushlendr's Avatar
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    10
    Vote Rating
    1
    koushlendr is on a distinguished road

      0  

    Question 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'
    }

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,081
    Answers
    675
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    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.

  3. #3
    Sencha Premium Member koushlendr's Avatar
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    10
    Vote Rating
    1
    koushlendr is on a distinguished road

      0  

    Default


    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 ?

Thread Participants: 1

Tags for this Thread