template::util::textdate_localized_format (public)
template::util::textdate_localized_format
Defined in packages/acs-templating/tcl/date-procs.tcl
Gets the localized format for the textdate widget
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: # we get the date format for the connected locale from acs-lang.localization-d_fmt # as of the time of writing this proc the following were by default available that # would work with this proc, and this should cover most installations, if this # format isn't matched we will use the iso standard YYYY-MM-DD. # # %d-%m-%y %d.%m.%y %d/%m-%y %d/%m/%y %m/%d/%y %y-%m-%d %y.%m.%d "%d-%m-%y" set format [lc_get "d_fmt"] regsub -all -nocase -- {\"} $format {} format regsub -all -nocase -- {\%} $format {} format set format [string tolower $format] # this format key must now be at max five characters, and contain one y, one m and one d # as well as two punction marks ( - . / ) if { [regexp {^([y|m|d])([\-|\.|/])([y|m|d])([\-|\.|/])([y|m|d])} $format match first first_punct second second_punct third] && [string length $format] == 5 } { if { [lsort [list $first $second $third]] eq "d m y" } { # we have a valid format from acs-lang.localization-d_fmt with all 3 necessary elements # and only two valid punctuation marks regsub {d} $format {dd} format regsub {m} $format {mm} format regsub {y} $format {yyyy} format return $format } } # we use the iso standard return "yyyy-mm-dd"XQL Not present: Generic, PostgreSQL, Oracle