Index: openacs-4/packages/acs-templating/tcl/date-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/date-procs.tcl,v
diff -u -r1.35.2.5 -r1.35.2.6
--- openacs-4/packages/acs-templating/tcl/date-procs.tcl 27 Apr 2006 02:23:49 -0000 1.35.2.5
+++ openacs-4/packages/acs-templating/tcl/date-procs.tcl 27 Apr 2006 03:51:48 -0000 1.35.2.6
@@ -1307,9 +1307,11 @@
upvar $element_reference element
+ set date_valid_p 0
if { [info exists element(value)] } {
set textdate $element(value)
if { [regexp {^([0-9]{4})-([0-9]{2})-([0-9]{2})$} $textdate match year month day] } {
+ set date_valid_p [string is false [catch { clock scan "${textdate}" }]]
# we have a correctly formatted iso date that we
# can reformat for display, we don't use lc_time_fmt
# because it could fail and cause a server error.
@@ -1327,9 +1329,15 @@
set textdate ""
}
+ if { $date_valid_p } {
+ set javascriptdate $textdate
+ } else {
+ set javascriptdate ""
+ }
+
if { [string equal $element(mode) "edit"] } {
append output ""
- append output ""
+ append output ""
} else {
append output $textdate
append output ""