summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-21 19:22:02 +0200
committerThanos Apollo <[email protected]>2023-12-21 19:22:02 +0200
commit3ede54117d2222c41e960d8411aa26e34c52cd49 (patch)
treefab709634ac1a812a744eaf7bedd7e7ae2f7fbb1
parent5d95819dee1d56b21469877afcaabb0234c70244 (diff)
Update algorithm
-rw-r--r--gnosis-algorithm.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/gnosis-algorithm.el b/gnosis-algorithm.el
index 1fe0f0a..3295e50 100644
--- a/gnosis-algorithm.el
+++ b/gnosis-algorithm.el
@@ -71,11 +71,12 @@ Optional integer OFFSET is a number of days from the current date."
(+ offset (calendar-absolute-from-gregorian now))))))
(list (nth 2 date) (nth 0 date) (nth 1 date)))))
-(defun gnosis-algorithm-date-diff (year month day)
- "Find the difference between the current date and the given date.
+(defun gnosis-algorithm-date-diff (date)
+ "Find the difference between the current date and the given DATE.
+DATE format must be given as (yyyy mm dd)
The structure of the given date is (YEAR MONTH DAY)."
- (let ((given-date (encode-time 0 0 0 day month year)))
+ (let ((given-date (encode-time 0 0 0 (caddr date) (cadr date) (car date))))
(- (time-to-days (current-time))
(time-to-days given-date))))
@@ -118,7 +119,7 @@ Returns a tuple: (INTERVAL N EF) where,
(t (if (= success 1)
(* ef last-interval)
(* ff last-interval))))))
- (list (gnosis-algorithm-date (round interval)) (1+ n) next-ef)))
+ (list (gnosis-algorithm-date (round interval)) next-ef)))
(provide 'gnosis-algorithm)
;;; gnosis-algorithm.el ends here