User tests: Successful: Unsuccessful:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33168
Use form field with type="Time" and name="name" to test.
Form field "Time" allows user to easily select time from a drawer.
Configurable parameters:-
starthour : 0-23
endhour : 0-23
showminutes : true/false
minutedivisions : 2,3,4,6,7,12
military : true/false (24 hr format)
event : 'focus', 'click', 'mouseover'
layout : 'horizontal' / 'vertical'
hoursopacity : 0-1
minutesopacity : 0-1
showbutton : true/false
callback : js function
Closed as per the comment on the tracker
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-08-08 14:20:58 |
Thanks for this idea.
Just tested it and unfortunately it doesn't work well. The JavaScript part itself does work, but the HTML for the formfield is wrong and doesn't follow Joomla standards.
Please have a look at the calendar formfield or any other one which does append a button to the field. You should use the proper CSS classes ("input-append") here. Also the field needs an id and the name needs to be in the form
jform[name]
where you havejformname
. The button needs a different id as well, that one should be used for the field itself.I think the default format for the time should be HH:MM:SS as that is how it's stored in the database.
If you want to apply formatings, better use a format parameter. The parameter "military" doesn't help as this is something depending on the used language/region. It's not something which should be set in the code itself. Better would be to have a translateable format, but then you face the issue that you need to change the format back to HH:MM:SS before sending the form, otherwise the database/component using it will not know how to process it.
Another thing to consider is that Joomla usually stores dates (and times?) as UTC, and calculates them back depending on server or user timezone settings.
That said, I'm not that sure how much value this brings. I think most people are faster inputing the time directly into the form instead of selecting it from a JavaScript widget.