ad_dateentrywidget (public, deprecated)
ad_dateentrywidget column [ value ]
Defined in packages/acs-tcl/tcl/widgets-procs.tcl
Deprecated. Invoking this procedure generates a warning.
Returns form pieces for a date entry widget. A null date may be selected. DEPRECATED: better alternatives exist for date-entry widgets, which would also support localization.
- Parameters:
- column (required)
- value (optional, defaults to
"0"
)- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: ad_log_deprecated proc ad_dateentrywidget # if you would like the default to be null, call with value= "" set NS(months) [list January February March April May June July August September October November December] if { $value == 0 } { # no default, so use today set value [lindex [split [ns_localsqltimestamp] " "] 0] } if { $value eq "" } { set month "" set day "" set year "" } else { lassign [split $value "-"] year month day # trim the day, in case we get as well a timestamp regexp {^([0-9]+) } $day _ day } set output "<select name=\"$column.month\">\n" # take care of cases like 09 for month regsub "^0" $month "" month for {set i 0} {$i < 12} {incr i} { if { $month ne "" && $i == $month - 1 } { append output "<option selected=\"selected\">[lindex $NS(months) $i]</option>\n" } else { append output "<option>[lindex $NS(months) $i]</option>\n" } } append output [subst {</select><input name="$column.day" type="text" size="2" maxlength="2" value="$day"> <input name="$column.year" type="text" size="4" maxlength="4" value="$year">}] return $outputXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/widgets-procs.xql