summaryrefslogtreecommitdiffstats
path: root/library/clock.tcl
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2008-02-27 02:08:23 (GMT)
committerKevin B Kenny <kennykb@acm.org>2008-02-27 02:08:23 (GMT)
commitbd73b8d2cd6de4ced39064b2c152e692c2ebe342 (patch)
tree6b2e7fe61cec45eb7e135a8d0a03c2ed79792b72 /library/clock.tcl
parentc1320be6a02548d913477b41e87c5227fa57b5b8 (diff)
downloadtcl-bd73b8d2cd6de4ced39064b2c152e692c2ebe342.zip
tcl-bd73b8d2cd6de4ced39064b2c152e692c2ebe342.tar.gz
tcl-bd73b8d2cd6de4ced39064b2c152e692c2ebe342.tar.bz2
* doc/clock.n: Corrected minor indentation gaffe in the
penultimate paragraph. [Bug 1898025] * generic/tclClock.c (ParseClockFormatArgs): Changed to check that the clock value is in the range of a 64-bit integer. [Bug 1862555] * library/clock.tcl (::tcl::clock::format, ::tcl::clock::scan, ::tcl::clock::add, ::tcl::clock::LocalizeFormat): Fixed bugs in caching of localized strings that caused weird results when localized date/time formats were used. [Bug 1902423] * tests/clock.test (clock-61.*, clock-62.1): Regression tests for [Bug 1862555] and [Bug 1902423].
Diffstat (limited to 'library/clock.tcl')
-rw-r--r--library/clock.tcl15
1 files changed, 8 insertions, 7 deletions
diff --git a/library/clock.tcl b/library/clock.tcl
index 79ffc3e..c657234 100644
--- a/library/clock.tcl
+++ b/library/clock.tcl
@@ -13,7 +13,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: clock.tcl,v 1.46 2008/02/06 01:13:07 kennykb Exp $
+# RCS: @(#) $Id: clock.tcl,v 1.47 2008/02/27 02:08:27 kennykb Exp $
#
#----------------------------------------------------------------------
@@ -668,6 +668,7 @@ proc ::tcl::clock::format { args } {
variable TZData
lassign [ParseFormatArgs {*}$args] format locale timezone
+ set locale [string tolower $locale]
set clockval [lindex $args 0]
# Get the data for time changes in the given zone
@@ -1222,7 +1223,7 @@ proc ::tcl::clock::scan { args } {
set string [lindex $args 0]
set format {}
set gmt 0
- set locale C
+ set locale c
set timezone [GetSystemTimeZone]
# Pick up command line options.
@@ -1240,7 +1241,7 @@ proc ::tcl::clock::scan { args } {
set gmt $value
}
-l - -lo - -loc - -loca - -local - -locale {
- set locale $value
+ set locale [string tolower $value]
}
-t - -ti - -tim - -time - -timez - -timezo - -timezon - -timezone {
set timezone $value
@@ -2379,7 +2380,7 @@ proc ::tcl::clock::EnterLocale { locale oldLocaleVar } {
set locale ${oldLocale}_windows
if { ![dict exists $McLoaded $locale] } {
LoadWindowsDateTimeFormats $locale
- dict set mcloaded $locale {}
+ dict set McLoaded $locale {}
}
}
}
@@ -2575,7 +2576,7 @@ proc ::tcl::clock::LocalizeFormat { locale format } {
%EY [mc LOCALE_YEAR_FORMAT]\
%+ {%a %b %e %H:%M:%S %Z %Y}] $format]
- dict set McLoaded $locale FORMAT $format $inFormat
+ dict set McLoaded $locale FORMAT $inFormat $format
return $format
}
@@ -4331,7 +4332,7 @@ proc ::tcl::clock::add { clockval args } {
set offsets {}
set gmt 0
- set locale C
+ set locale c
set timezone [GetSystemTimeZone]
foreach { a b } $args {
@@ -4348,7 +4349,7 @@ proc ::tcl::clock::add { clockval args } {
set gmt $b
}
-l - -lo - -loc - -loca - -local - -locale {
- set locale $b
+ set locale [string tolower $b]
}
-t - -ti - -tim - -time - -timez - -timezo - -timezon -
-timezone {