PDA

View Full Version : How-to change initDate to be conformable to date value



andsm
1 Feb 2013, 5:19 AM
My TimeField on a form loaded with loadRecord method.
But when the first change of the data occures date part of the value reset to 01/01/2008.

Can I change initDate value, that it always be a date part of value that I load from record?

mitchellsimoens
4 Feb 2013, 12:47 PM
I'm not sure I understand what you mean by "date part of the value"

andsm
5 Feb 2013, 6:56 AM
I'll try to explain the problem better.

I have a simple form and TimeField component on it. 41684
Initialy value for TimeField loaded from record (some data.Model instance).
Appropriate time value is displayed in the TimeField and after I press "submit" button form submit next value:
2013-02-05 16:40:27
Well, then I change time value and submit form again and unexpectedly get the next result:
2008-01-01 01:00:00
The time part of the value is right I have selected it, but Date part of the value have been reset to default value that TimeField component store in initialDate variable of the class.

How I can avoid this problem?
The form have been build on the assumption, that time value can be selected within particular date.