Forum OpenACS Q&A: Response to Events module - event-edit.tcl doesn't post the time values to events.edit-2.tcl

Hello Chris,

this is a highly complex procedure travel... We didn't figure out how to fix the "AM / PM - time" problem because nobody knows what AM PM is in Germany. We replaced it with a 24h timestamp.

The time data travels through quite some procs that you will find inside "/tcl/ad-aolserver-3.tcl.preload":

in event-edit.tcl you start with

1. set stuffed_with_start [ns_dbformvalueput $time_elements "start_time" "timestamp" $start_timestamp]
set stuffed_with_se [ns_dbformvalueput $stuffed_with_start "end_time" "timestamp" $end_timestamp]
set stuffed_with_all_times [ns_dbformvalueput $stuffed_with_se "reg_deadline" "timestamp" $deadline_timestamp]

2. ns_dbformvalueput (the type is timestamp)

3. ns_parsesqltimestamp (now it gets a little strange for beginners like us - pay attention to opt = time - there is a "-" and not like in ampm a "{return [ns_parsesqldate $opt [lindex [split $sqltimestamp " "] 0]]}" which lets the data go to ns_parsesqldate...


We inserted new options in three procs:
1. ns_dbformvalueput - we exhanged the following
set retval [ns_formvalueput $retval ColValue.[ns_urlencode $column].time
[ns_parsesqltimestamp time $value]]
set retval [ns_formvalueput $retval ColValue.[ns_urlencode $column].ampm
[ns_parsesqltimestamp ampm $value]]
into
set retval [ns_formvalueput $retval ColValue.[ns_urlencode $column].time
[ns_parsesqltimestamp time24 $value]]

2.) ns_parsesqltimestamp - we added one line:
time24 {return [ns_parsesqltime $opt [lindex [split $sqltimestamp " "] 1]]}

3.) ns_parsesqltime - we added three lines:
time24 {
return [format "%d:%02d" $hours $minutes]
}

It works for us now....

Maybe you could fix the am/pm thing and Roberto could use it inside the 3.2.5 Release?!