1. #1
    Sencha User
    Join Date
    Oct 2010
    Posts
    33
    Vote Rating
    0
    Answers
    2
    marc123 is on a distinguished road

      0  

    Default Unanswered: how to format value of datefield on submit

    Unanswered: how to format value of datefield on submit


    Hi,

    I have a datefield that submits a datetime value to the server. Problem is, the datetime value is not of type date. This is submitted:

    "START_VALIDITY_DATE":"2012-09-07T00:00:00",

    The "T" in 2012-09-07T00:00:00 should not be there. I'd rather only have the date (2012-09-07). How can I tell ext (3.4) to change the format of the datevalue it's submitting?

    Code:
    ,{
                        xtype: 'datecolumn',
                        header: 'Valid from',
                        dataIndex: 'START_VALIDITY_DATE',
                        sortable: true,
                        format: 'd-n-Y',
                        editor:{
                                    xtype: 'datefield',
                                    format:'m/d/Y',
                                    allowBlank: false,
                                    altFormats:'d/n/Y|d n Y',
                                    minValue: (new Date()).format('m/d/Y'),
                                    minText: 'Can\'t set a start date in the past.'
                                    //maxValue: (new Date()).format('m/d/Y')
                                }
    }

  2. #2
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    326
    Vote Rating
    12
    Answers
    5
    Zdeno will become famous soon enough

      0  

    Default


    This is ExtJS 4.x forum.

    Check http://www.sencha.com/forum/showthre...e-submitFormat and override it to Ext 3.

    Why do you need change format? Whats on server side? .Net, PHP or anything else?