diff options
author | gahr <gahr@gahr.ch> | 2016-02-23 16:31:18 (GMT) |
---|---|---|
committer | gahr <gahr@gahr.ch> | 2016-02-23 16:31:18 (GMT) |
commit | e644c2cde0ad8530628e57c4dba5797fc5ff3b85 (patch) | |
tree | d1d7688693a4d47297d51538354f9ea9b606dad6 /library/clock.tcl | |
parent | 03dd6c13603af9d6792030412f52d942fc2eaefd (diff) | |
download | tcl-e644c2cde0ad8530628e57c4dba5797fc5ff3b85.zip tcl-e644c2cde0ad8530628e57c4dba5797fc5ff3b85.tar.gz tcl-e644c2cde0ad8530628e57c4dba5797fc5ff3b85.tar.bz2 |
Make sure that adding 0 weekdays doesn't result in going back in time
Diffstat (limited to 'library/clock.tcl')
-rwxr-xr-x | library/clock.tcl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index 231f1ae..535a67d 100755 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -4449,6 +4449,10 @@ proc ::tcl::clock::AddMonths { months clockval timezone changeover } { proc ::tcl::clock::AddWeekDays { days clockval timezone changeover } { + if {$days == 0} { + return $clockval + } + set day [format $clockval -format %u] set weeks [expr {$days / 5}] |