[date-utilities.scm] typo fix and deprecate unused functions

This commit is contained in:
Christopher Lam
2021-03-07 10:24:05 +08:00
parent 7bacd82cad
commit 3739d9121c

View File

@@ -790,12 +790,13 @@ Defaulting to today."))
(gnc-mktime now))))
(define (gnc:get-three-months-ago)
(issue-deprecation-warning "gnc:get-three-months-ago is unused.")
(let ((now (gnc-localtime (current-time))))
(if (< (tm:mon now) 3)
(begin
(set:tm-mon now (+ (tm:mon now) 12))
(set:tm-year now (- (tm:year now) 1))))
(set:tm-mon now (- (tm:mon now) 3))
(set-tm:mon now (+ (tm:mon now) 12))
(set-tm:year now (- (tm:year now) 1))))
(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))
@@ -804,12 +805,13 @@ Defaulting to today."))
(gnc-mktime now))))
(define (gnc:get-six-months-ago)
(issue-deprecation-warning "gnc:get-six-months-ago is unused.")
(let ((now (gnc-localtime (current-time))))
(if (< (tm:mon now) 6)
(begin
(set:tm-mon now (+ (tm:mon now) 12))
(set:tm-year now (- (tm:year now) 1))))
(set:tm-mon now (- (tm:mon now) 6))
(set-tm:mon now (+ (tm:mon now) 12))
(set-tm:year now (- (tm:year now) 1))))
(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))
@@ -818,8 +820,9 @@ Defaulting to today."))
(gnc-mktime now))))
(define (gnc:get-one-year-ago)
(issue-deprecation-warning "gnc:get-one-year-ago is unused.")
(let ((now (gnc-localtime (current-time))))
(set:tm-year now (- (tm:year now) 1))
(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))
@@ -842,12 +845,13 @@ Defaulting to today."))
(gnc-mktime now))))
(define (gnc:get-three-months-ahead)
(issue-deprecation-warning "gnc:get-three-months-ahead is unused.")
(let ((now (gnc-localtime (current-time))))
(if (> (tm:mon now) 8)
(begin
(set:tm-mon now (- (tm:mon now) 9))
(set:tm-year now (+ (tm:year now) 1))
(set:tm-mon now (+ (tm:mon now) 3))))
(set-tm:mon now (- (tm:mon now) 9))
(set-tm:year now (+ (tm:year now) 1))
(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))
@@ -856,12 +860,13 @@ Defaulting to today."))
(gnc-mktime now))))
(define (gnc:get-six-months-ahead)
(issue-deprecation-warning "gnc:get-six-months-ahead is unused.")
(let ((now (gnc-localtime (current-time))))
(if (> (tm:mon now) 5)
(begin
(set:tm-mon now (- (tm:mon now) 6))
(set:tm-year now (+ (tm:year now) 1))
(set:tm-mon now (+ (tm:mon now) 6))))
(set-tm:mon now (- (tm:mon now) 6))
(set-tm:year now (+ (tm:year now) 1))
(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))
@@ -870,8 +875,9 @@ Defaulting to today."))
(gnc-mktime now))))
(define (gnc:get-one-year-ahead)
(issue-deprecation-warning "gnc:get-one-year-ahead is unused.")
(let ((now (gnc-localtime (current-time))))
(set:tm-year now (+ (tm:year now) 1))
(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))