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):
%3 template::data::transform::textdate template::data::transform::textdate (public) template::util::textdate_localized_format template::util::textdate_localized_format template::data::transform::textdate->template::util::textdate_localized_format template::data::validate::textdate template::data::validate::textdate (public) template::data::validate::textdate->template::util::textdate_localized_format template::widget::textdate template::widget::textdate (public) template::widget::textdate->template::util::textdate_localized_format lc_get lc_get (public) template::util::textdate_localized_format->lc_get

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
[ hide source ] | [ make this the default ]
Show another procedure: