Question

I am using ExtJS version 3.0.0 and I really don't know why every time I submit a form with a datefield, the date is send to POST like this: Y-7-31 0:i:0 . I have not extended/modified the datefield code, anybody else encountered this problem ?

EDIT: I am actually using the datetimefield extension (found here) and the config is this:

{
                 xtype:'xdatetime'
                ,id:'date_edit_task'
                ,name: 'data'
                ,fieldLabel:'Insert date and time'
                ,anchor:'-18'
                ,timeFormat:'H:i:s'
                ,timeConfig: {
                altFormats:'H:i:s'
                ,allowBlank:true    
                }
                ,dateFormat:'d-m-Y'
                ,dateConfig: {
                altFormats:'Y-m-d|Y-n-d'
                ,editable: false
                ,allowBlank:true    
                }
            }

I have also read the forum pages of this extension and noticed another guy having the same problem, here is the link to his post: same problem link . Over there, Jsakalos asks about hiddenFormat config. Mine is hiddenFormat:'Y-m-d H:i:s'.

Any ideas ?

Thanks.

Was it helpful?

Solution

If you have the ability to upgrade to ExtJS 3.3.x, then you could just switch to a compositeField instead of using this user extension. Something like:

{
    xtype: 'compositefield',
    fieldLabel: 'Date/Time',
    labelWidth: 120
    items: [
    {
        xtype     : 'datefield',
        name      : 'xdate'
    },
    {
        xtype     : 'timefield',
        name      : 'xtime'
    }]
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top