Bug #557604: Fix date-utilities.scm typos.

src/app-utils/date-utilities.scm has a few typos ("set:tm-month" instead of
"set:tm-mon" and a few misplaced parens). This is at least as old as 2.2.6 and
still exists on trunk.

Patch by Wolfgang Schnerring, but the first hunk had one parentheses too many; fixed by me.
BP

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17658 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2008-10-25 20:31:13 +00:00
parent 47a9693ce6
commit 5ca984954c

View File

@ -610,12 +610,12 @@
(let ((now (localtime (current-time))))
(if (< (tm:mon now) 3)
(begin
(set:tm-month now (+ (tm:mon now) 12))
(set:tm-mon now (+ (tm:mon now) 12))
(set:tm-year now (- (tm:year now) 1))))
(set:tm-month now (- (tm:mon now) 3))
(let ((month-days) (gnc:days-in-month (+ (tm:mon now) 1)
(+ (tm:year now) 1900)))
(if (> (month-days) (tm:mday now))
(set:tm-mon now (- (tm:mon now) 3))
(let ((month-days (gnc:days-in-month (+ (tm:mon now) 1)
(+ (tm:year now) 1900))))
(if (> month-days (tm:mday now))
(set-tm:mday now month-days))
(set-tm:isdst now -1)
(gnc:date->timepair now))))
@ -624,12 +624,12 @@
(let ((now (localtime (current-time))))
(if (< (tm:mon now) 6)
(begin
(set:tm-month now (+ (tm:mon now) 12))
(set:tm-mon now (+ (tm:mon now) 12))
(set:tm-year now (- (tm:year now) 1))))
(set:tm-month now (- (tm:mon now) 6))
(let ((month-days) (gnc:days-in-month (+ (tm:mon now) 1)
(+ (tm:year now) 1900)))
(if (> (month-days) (tm:mday now))
(set:tm-mon now (- (tm:mon now) 6))
(let ((month-days (gnc:days-in-month (+ (tm:mon now) 1)
(+ (tm:year now) 1900))))
(if (> month-days (tm:mday now))
(set-tm:mday now month-days))
(set-tm:isdst now -1)
(gnc:date->timepair now))))
@ -637,9 +637,9 @@
(define (gnc:get-one-year-ago)
(let ((now (localtime (current-time))))
(set:tm-year now (- (tm:year now) 1))
(let ((month-days) (gnc:days-in-month (+ (tm:mon now) 1)
(+ (tm:year now) 1900)))
(if (> (month-days) (tm:mday now))
(let ((month-days (gnc:days-in-month (+ (tm:mon now) 1)
(+ (tm:year now) 1900))))
(if (> month-days (tm:mday now))
(set-tm:mday now month-days))
(set-tm:isdst now -1)
(gnc:date->timepair now))))