Commit 899b758b authored by Frank Bergmann's avatar Frank Bergmann

- added code to allow the date-widget to deal with YYYY-MM-DD date format

parent 67412fa7
......@@ -999,7 +999,7 @@ ad_proc -public template::widget::date { element_reference tag_attributes } {
set output "<!-- date $element(name) begin -->\n"
if { ! [info exists element(format)] } {
set element(format) "DD MONTH YYYY"
set element(format) "DD MONTH YYYY"
}
# Choose a pre-selected format, if any
......@@ -1036,6 +1036,14 @@ ad_proc -public template::widget::date { element_reference tag_attributes } {
set value {}
}
# Deal with ]project-open[ date format "YYYY-MM-DD"
ns_log Notice "template::widget::date: value.before=$value"
if {[regexp {^(....)\-(..)\-(..)$} $value match year month day]} {
set value "$year [template::util::leadingTrim $month] [template::util::leadingTrim $day]"
}
ns_log Notice "template::widget::date: value.after=$value"
# Keep taking tokens off the top of the string until out
# of tokens
set format_string $element(format)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment