donb
committed
on 21 May 02
Fixed a bug I introduced inadvertently to get_property(sql_date)
openacs-4/.../acs-templating/tcl/date-procs.tcl (+2 -1)
216 216       for { set i 0 } { $i < 6 } { incr i } {
217 217         if { ![string equal [lindex $date $i] {}] } {
218 218           return 1
219 219         }
220 220       }
221 221       return 0
222 222     }
223 223     sql_date {
224 224       set value ""
225 225       set format ""
226 226       set space ""
227 227       set pad "0000"
228 228       foreach { index sql_form } { 0 YYYY 1 MM 2 DD 3 HH24 4 MI 5 SS } {
229 229         set piece [lindex $date $index]
230 230         if { ![string equal $piece {}] } {
231 231           append value "$space[string range $pad [string length $piece] end]$piece"
232 232           append format $space
233 233           append format $sql_form
234 234           set space " "
235 235         }
  236         set pad "00"
236 237       }
237 238       return "to_date('$value', '$format')"
238 239     }
239 240     linear_date {
240 241       # Return a date in format "YYYY MM DD HH24 MI SS"
241 242       # For use with karl's non-working form builder API
242 243       set clipped_date [lrange $date 0 5]
243 244       set ret [list]
244 245       set pad "0000"
245 246       foreach fragment $clipped_date {
246 247         lappend ret "[string range $pad [string length $fragment] end]$fragment"
247 248         set pad "00"
248 249       }
249 250       return $ret
250 251     }
251 252     display_date {
252 253
253 254       # Return a beautified date.  It should use the widget format string but DRB
254 255       # doesn't have the time to dive into that today.  The simple hack would be
255 256       # to use the database's to_char() function to do the conversion but that's