template::data::transform::date (public)
template::data::transform::date element_ref
Defined in packages/acs-templating/tcl/date-procs.tcl
Collect a Date object from the form.
- Parameters:
- element_ref (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: upvar $element_ref element set element_id $element(id) set the_date [template::util::date::create {} {} {} {} {} {} [ns_queryget "$element_id.format"]] set have_values 0 foreach field { year short_year month day short_hours hours minutes seconds ampm } { set key "$element_id.$field" if { [ns_queryexists $key] } { set value [ns_queryget $key] # Coerce values to nonnegative integers if { $field ne "ampm" } { if { ![regexp {[0-9]+} $value value] } { set value {} } } # If the value is not null, set it if { $value ne {} } { set the_date [template::util::date::set_property $field $the_date $value] if { $field ne "ampm" } { set have_values 1 } } } } if { $have_values } { return [list $the_date] } else { return {} }XQL Not present: Generic, PostgreSQL, Oracle