Index: openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl 18 Jul 2001 18:19:01 -0000 1.3 +++ openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl 22 Aug 2001 03:09:48 -0000 1.4 @@ -809,6 +809,28 @@ } +ad_proc ec_timeentrywidget_time_check { timestamp } { + checks to make sure that the time part of the timestamp is in the correct format: HH12:MI:SS. For instance 02:20:00. PostgreSQL does not like it when you leave out a digit (id 2:20:00) and it will complain. +} { + if { ![regexp -nocase {([0-9]+):([0-9]+):([0-9]+)} $timestamp match hours mins secs]} { + ad_return_complaint "1" "
  • The time part of the timestamp is not in the correct format. It must be HH12:MI:SS" + return -code return + } else { + # check to make sure each field has two digits + if ![regexp {[0-9][0-9]} $hours] { + set hours 0$hours + } + if ![regexp {[0-9][0-9]} $mins] { + set mins 0$mins + } + if ![regexp {[0-9][0-9]} $secs] { + set secs 0$secs + } + set time "$hours:$mins:$secs" + } + return $time +} + ad_proc ec_user_class_widget { {default ""} } { user class select } { set to_return "