summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index fcf94fc..fa67683 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -286,6 +286,15 @@ 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-date-difference (year month day)
+ "Find the difference between the current date and the given date.
+
+The structure of the given date is (YEAR MONTH DAY)."
+ (let ((current-date (gnosis-date-current))
+ (given-date (encode-time 0 0 0 day month year)))
+ (- (time-to-days (current-time))
+ (time-to-days given-date))))
+
(defun gnosis-calculate-e-factor (ef quality)
"Calculate new e-factor given existing EF and binary QUALITY, 0 or 1."
(cond