diff options
author | Thanos Apollo <[email protected]> | 2023-12-14 20:50:34 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-14 20:50:34 +0200 |
commit | efcd91978b90c724577d266428976d351dd2500e (patch) | |
tree | c5e0b26094e97fc28a87c4c63de57cd8fcc50d7f /gnosis.el | |
parent | dd40cde2399089ab28a62a32fec32320fa7f2ba0 (diff) |
Add gnosis-date-difference
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 |