PDA

View Full Version : Date Field with Time



vinothsencha
23 Aug 2013, 5:53 AM
When I choose any date in date field, it should display the selected date with current time.
For Example,
23-Aug-2013 19:25:41
Can you please someone tell me how it can be done?

damo
23 Aug 2013, 6:48 AM
This is the config option required for a datefield.


...
format: 'd-M-Y H:i:s'
...

AssetWorks
23 Aug 2013, 9:39 AM
if you choose a date and have the config to show format: 'd-M-Y H:i:s'
it will always show midnight. there is a datetime field that I cant remember who made it but its here
45512

Gary Schlosberg
26 Aug 2013, 9:05 AM
If you use the format provided by demo above, and use value: new Date(), you should get current date and time.


xtype: 'datefield',
format: 'd-M-Y H:i:s',
value: new Date() // defaults to today

AssetWorks
26 Aug 2013, 9:21 AM
new Date() will provide you with the date and time given that you use the format: 'd-M-Y H:i:s'
but the question was, how to get now time when picked a date out of the picker. there is no config for that you will need override picker.js which clears the time everytime it does a setValue.

Gary Schlosberg
26 Aug 2013, 10:48 AM
Right you are. It's there on the load, but not when you select. Thanks.

Neopulse
5 Nov 2013, 2:15 PM
How can I use this datetime picker???