Index: openacs-4/packages/acs-lang/tcl/localization-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/localization-procs.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/acs-lang/tcl/localization-procs.tcl 27 Oct 2014 16:39:38 -0000 1.24 +++ openacs-4/packages/acs-lang/tcl/localization-procs.tcl 7 Aug 2017 23:47:56 -0000 1.25 @@ -21,7 +21,7 @@ } { Converts a number to its canonical representation by stripping everything but the - decimal seperator and triming left 0's so it + decimal separator and triming left 0's so it won't be octal. It can process the following types of numbers:
Takes a grouping specifier and - inserts the given seperator into the string. + inserts the given separator into the string. Given a separator of : and a number of 123456789 it returns:
@@ -135,7 +132,7 @@ @param num_re Regular expression for valid numbers @return Number formatted with thousand separator } { - # with empty seperator or grouping string we behave + # with empty separator or grouping string we behave # posixly if {$grouping eq "" || $sep eq "" } { return $num @@ -172,7 +169,7 @@ for that locale. @param num Number in canonical form - @param fmt Format string used by the tcl format + @param fmt Format string used by the Tcl format command (should be restricted to the form "%.Nf" if present). @param locale Locale @return Localized form of the number @@ -294,7 +291,7 @@See also
man strftimeon a UNIX shell prompt for more of these abbreviations. @param locale Locale identifier must be in the locale database - @error Fails if given a non-existant locale or a malformed datetime + @error Fails if given a non-existent locale or a malformed datetime Doesn't check for impossible dates. Ask it for 29 Feb 1999 and it will tell you it was a Monday (1st March was a Monday, it wasn't a leap year). Also it only works with the Gregorian calendar - but that's reasonable, but could be a problem if you are running a seriously historical site @@ -305,7 +302,7 @@ return "" } - if { (![info exists locale] || $locale eq "") } { + if { $locale eq "" } { set locale [ad_conn locale] } @@ -326,7 +323,8 @@ error "Invalid date: $datetime" } } - + set lc_time_year [util::trim_leading_zeros $lc_time_year] + set a [expr {(14 - $lc_time_month) / 12}] set y [expr {$lc_time_year - $a}] set m [expr {$lc_time_month + 12*$a - 2}] @@ -582,3 +580,9 @@ } { return [format "%0${n_desired_digits}d" $the_integer] } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: