Functions:html select time

Creates select boxes for any/all of hour, minute, seconds and meridian.

html_select_time( [$prefix = "Time_", [$time = null, [$display_hours = true, [$display_minutes = true, [$display_seconds = true, [$display_meridian = true, [$use_24_hours = true, [$minute_interval = 1, [$second_interval = 1, [$field_array = null, [$all_extra = "", [$hour_extra = "", [$minute_extra = "", [$second_extra = "", [$meridian_extra = ""]]]]]]]]]]]]]]] )


 * prefix : the prefix to attach to name
 * time : the time to use, can be any value parseable by strtotime, a mysql timestamp or a unix timestamp
 * display_hours : show hours select box
 * display_minutes : show minutes select box
 * display_seconds : show seconds select box
 * display_meridian : show meridian (am/pm) select box
 * use_24_hours : use 24 hour times
 * minute_interval : interval to use in minute select box
 * second_interval : interval to use in second select box
 * field_array : use name arrays. ie. foo[hour], foo[minute]...
 * all_extra : extra attributes to add to all select boxes
 * hour_extra : extra attributes to add to the hour select box
 * minute_extra : extra attributes to add to the minute select box
 * second_extra : extra attributes to add to the second select box
 * meridian_extra : extra attributes to add to the meridian select box

Basic Usage: Output:  0 1 ... 22 23

 0 1 ... 35 36 ... 58 59

 0 1 ... 14 <option value='15'>15 ... <option value='58'>58 <option value='59'>59

Extended Example: Output: <select name='MyTime_Hour' > <option value='1'>1 ... <option value='11' selected='selected'>11 <option value='12'>12 <select name='MyTime_Minute' > <option value='0'>0 <option value='1'>1 ... <option value='38'>38 <option value='39' selected='selected'>39 ... <option value='58'>58 <option value='59'>59 <select name='MyTime_Meridian'> <option value='am'>AM <option value='pm' selected='selected'>PM

Version: 1.0.1

Discussion: Forum

Source: