edu_time_select_widget column { default_hour "9" } { default_minutes "00" } { default_half_day "am" }What it does:
This displays a time as select boxes defaulting to the values passed in.Defined in: /web/philip/tcl/education.tcl
Source code:
set hours_list [list 1 2 3 4 5 6 7 8 9 10 11 12] set minutes_list [list 00 05 10 15 20 25 30 35 40 45 50 55] set output "<select name=\"${column}_hour\">" foreach hour $hours_list { if {[string compare $default_hour $hour] == 0} { append output "<option value=$hour selected>$hour \n" } else { append output "<option value=$hour>$hour \n" } } append output " </select> <select name=\"${column}_minute\"> " foreach minute $minutes_list { if {[string compare $default_minutes $minute] == 0} { append output "<option value=$minute selected>$minute \n" } else { append output "<option value=$minute>$minute \n" } } append output " </select> <select name=${column}_ampm> " if {[string compare [string tolower $default_half_day] pm] == 0} { append output "<OPTION> AM <OPTION selected> PM " } else { append output "<OPTION selected> AM <OPTION> PM " } append output "</SELECT>" return $output