Closed (duplicate)
Project:
Helpers
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
1 Jun 2008 at 18:55 UTC
Updated:
9 Feb 2009 at 17:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
nancydruSounds useful. Do you have a patch and documentation?
Comment #2
tnanek commentedThe post was to see if it would be friendly, I'll start writing it now.
Comment #3
nancydruYes, it would be a good idea. First, see if the Date API module has this before spending much time on it.
I do ask that documentation (see the docs link from the project page) accompany the patch.
And when you submit a patch, assign the issue to yourself.
Comment #4
tnanek commentedHere's a patch - in looking at the other functions it seems the trend is to create an entire field to put in, but I felt uncomfortable doing that - what I wrote could be utilized to produce that easily enough though should that be the desired direction.
I havn't spent that much time on this, doing 5 things at once is the only reason why it took so long. I haven't yet looked at the date api either (saw your post after I produced the patch)
Comment #5
tnanek commentedCan't change assign when not creating a new post.
Comment #6
tnanek commentedFor the documentation page, should this patch be integrated:
time_select_for_form($hour = 12)
This will return the options selection for an '#options' for a selection. From this point, it is a relatively easy thing to construct a time selection.
Comment #7
nancydruI think typically, we would actually produce a form element(s). I'll take a look.
Only 5 things? That's taking it easy! ;-)
Comment #8
tnanek commentedOkay, updated it to fit with other parts of the module.
Documentation:
time_select_for_form($select, $hour = FALSE, $title = 'Time', $default_value = NULL, $required = FALSE, $description = '', $multiple = FALSE)
As far as other developments I could forsee doing in time (came to me when writing this post)
Add a prefix and suffix to the select adding div's (being dependant on the $select) for CSS guru's - having an hour select, a minute select, a second select, and an ampm select is all well and good, but by default they would be one above the other. Better if they are side by side.
In addition to provide an 'NA' option if it is not required (NA would work in a select for 2 numbers/letters as these all are).
Comment #9
nancydruThanks for this. I didn't particularly like it, but I did like the idea. #371604: Add a time form builder for forms
Comment #10
nancydru