Index: openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl 23 Jul 2018 12:46:53 -0000 1.17 +++ openacs-4/packages/acs-datetime/tcl/acs-datetime-procs.tcl 23 Jul 2018 12:54:26 -0000 1.18 @@ -144,10 +144,10 @@ set gregorian 2299161 if {$julian_date >= $gregorian} { - set calc [expr {floor((($julian_date - 1867216) - 0.25) / 36524.25)}] - set calc [expr {$julian_date + 1 + $calc - floor(0.25 * $calc)}] + set calc [expr {floor((($julian_date - 1867216) - 0.25) / 36524.25)}] + set calc [expr {$julian_date + 1 + $calc - floor(0.25 * $calc)}] } else { - set calc $julian_date + set calc $julian_date } # get initial calculations to set year, month, day @@ -160,10 +160,10 @@ set year [expr {floor($calc2 - 4715)}] set month [expr {floor($calc4 - 1)}] if {$month > 12} { - set month [expr {$month - 12}] + set month [expr {$month - 12}] } if {$month > 2 || $year <= 0} { - set year [expr {$year - 1}] + set year [expr {$year - 1}] } set day [expr {floor($calc - $calc3 - floor($calc4 * 30.6001))}] @@ -216,7 +216,7 @@ set month 01 } elseif {$month == 12} { incr year - set month 01 + set month 01 } elseif {$month == 13} { incr year set month 02 @@ -265,10 +265,10 @@ @return the ANSI date for the previous month } { if {$month == 1} { - set year [expr {$year - 1}] - set month 12 + set year [expr {$year - 1}] + set month 12 } else { - set month [expr {$month - 1}] + set month [expr {$month - 1}] } # jarkko: added this check to avoid calendars bombing when prev month goes @@ -310,10 +310,10 @@ @return the ANSI date for the previous month } { if {$month == 1} { - set year [expr {$year - 1}] - set month 12 + set year [expr {$year - 1}] + set month 12 } else { - set month [expr {$month - 1}] + set month [expr {$month - 1}] } # jarkko: added this check to avoid calendars bombing when prev month goes @@ -599,7 +599,6 @@ return $precision } - # Local variables: # mode: tcl # tcl-indent-level: 4