在POST中ExtJS奇怪的dateTimeField值

时间:2011-08-18 11:06:56

标签: extjs datefield

我使用的是ExtJS 3.0.0版,我真的不知道为什么每次提交带有日期字段的表单时,日期都会发送到POST:Y-7-31 0:i:0。我没有扩展/修改日期字段代码,还有其他人遇到过这个问题吗?

编辑:我实际上正在使用datetimefield扩展名(found here),配置如下:

{
                 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    
                }
            }

我还阅读了此扩展程序的论坛页面,并注意到另一个有同样问题的人,这里是他的帖子的链接:same problem link。在那里,Jsakalos询问hiddenFormat配置。我的是hiddenFormat:'Y-m-d H:i:s'

有什么想法吗?

感谢。

1 个答案:

答案 0 :(得分:0)

如果您能够升级到ExtJS 3.3.x,那么您可以切换到compositeField而不是使用此用户扩展。类似的东西:

{
    xtype: 'compositefield',
    fieldLabel: 'Date/Time',
    labelWidth: 120
    items: [
    {
        xtype     : 'datefield',
        name      : 'xdate'
    },
    {
        xtype     : 'timefield',
        name      : 'xtime'
    }]
}