summaryrefslogtreecommitdiffstats
path: root/library/clock.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/clock.tcl')
-rw-r--r--library/clock.tcl24
1 files changed, 12 insertions, 12 deletions
diff --git a/library/clock.tcl b/library/clock.tcl
index c24a589..0c8bdaa 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.25 2005/12/01 22:38:05 kennykb Exp $
+# RCS: @(#) $Id: clock.tcl,v 1.26 2005/12/02 16:58:13 kennykb Exp $
#
#----------------------------------------------------------------------
@@ -652,8 +652,6 @@ proc ::tcl::clock::Initialize {} {
proc ::tcl::clock::format { args } {
- variable TZData
-
set format {}
# Check the count of args
@@ -731,16 +729,10 @@ proc ::tcl::clock::format { args } {
return -options $opts $retval
}
- # Extract the fields of the date.
-
- set date [GetDateFields $clockval \
- $TZData($timezone) \
- [mc GREGORIAN_CHANGE_DATE]]
-
# Format the result
set formatter [ParseClockFormatFormat $format $locale]
- return [$formatter $date $TZData($timezone)]
+ return [$formatter $clockval $timezone]
}
@@ -802,7 +794,15 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} {
set didLocaleEra 0
set didLocaleNumerals 0
- set preFormatCode {}
+ set preFormatCode \
+ [string map [list @GREGORIAN_CHANGE_DATE@ \
+ [mc GREGORIAN_CHANGE_DATE]] \
+ {
+ variable TZData
+ set date [GetDateFields $clockval \
+ $TZData($timezone) \
+ @GREGORIAN_CHANGE_DATE@]
+ }]
set formatString {}
set substituents {}
set state {}
@@ -1207,7 +1207,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} {
}
}
- proc $procName {date changeover} "
+ proc $procName {clockval timezone} "
$preFormatCode
return \[::format [list $formatString] $substituents\]
"