Closed czuck closed 11 years ago
You can make this work if you set the time output format to not zero-pad as well. %-I:%M %p (12hr) or %-H:%M (24hr) - the option for that is overrideTimeOutput
I'm still having an issue with this. If I change the code to:
data-options='{"mode": "timeflipbox", "useFocus": true, "centerHoriz":true, "themeHeader":"b", "themeDatePick":"b", "overrideTimeOutput":" %-I:%M"}'
then when I open the datebox the time is the current time, not the time it was set to, regardless of the number if digits.
If I change it to this:
data-options='{"mode": "timeflipbox", "useFocus": true, "centerHoriz":true, "themeHeader":"b", "themeDatePick":"b", "timeOutput":" %-I:%M"}'
then it works as I described before, where the leading 0 is required. I am using a 12 hr clock.
Can you see my error or point me to an example that works?
the only error I see in what you pasted is a lack of %p or %P (no way to tell AM/PM or am/pm). Here is a working example, with a time in the value="" field in the source.
Thanks, that did it!
Using the code: input name="StartTime" id="StartTime" type="date" data-role="datebox" data-options='{"mode": "timeflipbox", "useFocus": true, "centerHoriz":true, "themeHeader":"b", "themeDatePick":"b"}' value="@Model.StartTime.ToShortTimeString()"
if the hours of the StartTime contains only one digit, the time will not pre-populate when the datebox is opened. It does display in the date dialog correctly. If the StartTime contains a 2-digit hour, then it works.