简体   繁体   English

Ext.form.field.Time提交为日期时间值

[英]Ext.form.field.Time commits as Date-Time value

I have an Ext.form.field.Time editor on my screen. 我的屏幕上有一个Ext.form.field.Time编辑器。 I would like it to represent only time values, not date-time. 我希望它仅代表时间值,而不代表日期时间。 I know that it is still an Ext.form.field.Date behind the scenes and the editor ignores the date part. 我知道它仍然是一个Ext.form.field.Date在幕后,编辑器忽略了日期部分。 But I want it also to commit as a time to the server. 但我希望它也可以作为服务器的时间。 For this purpose I set the property submitFormat: 'H:i' . 为此,我设置属性submitFormat: 'H:i' But for an input of 02:00 , extjs still sends down the response as 2008-01-01T02:00:00 . 但是对于02:00的输入,extjs仍将响应发送为2008-01-01T02:00:00 Any ideas on how to make it commit with the time portion only? 关于如何使其仅与时间部分一起提交的任何想法? Thanks. 谢谢。

(I am on Extjs 4.2.2) (我在Extjs 4.2.2上)

I created a Fiddle here and it seems like it is working correctly. 我在这里创建了一个小提琴 ,看来它工作正常。 I've also tried calling form.submit() and the form data shows up correctly as well. 我也尝试调用form.submit(),并且表单数据也正确显示。 How are you getting the data? 您如何获取数据? Are you calling timefield.getValue() instead of timefield.getSubmitValue() ? 您是在调用timefield.getValue()而不是timefield.getSubmitValue()吗? That seems to return the full date string. 那似乎返回完整的日期字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM