diff options
author | Thanos Apollo <[email protected]> | 2023-12-14 02:22:11 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-14 02:22:11 +0200 |
commit | e4f9ee8d25273f75d969cded84019baea07883f7 (patch) | |
tree | c499f2159671425fe5f44d85dc5ef01b7d7e718a | |
parent | e9f1c48395f19a1988bcf3d16ca8b292a76313e0 (diff) |
Add #'(gnosis-current-date)
Get current date in (yyyy mm dd) & add offset.
Inspired by calendar-current-date func
Changed format to (year month day)
-rw-r--r-- | gnosis.el | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -236,6 +236,19 @@ Used to calcuate new interval for failed questions." :group 'gnosis :type 'float) +(defun gnosis-current-date (&optional offset) + "Return the current date in a list (year month day). +Optional integer OFFSET is a number of days from the current date." + (let* ((now (decode-time)) + (now (list (decoded-time-month now) + (decoded-time-day now) + (decoded-time-year now)))) + (let ((date (if (zerop (or offset 0)) + now + (calendar-gregorian-from-absolute + (+ offset (calendar-absolute-from-gregorian now)))))) + (list (nth 2 date) (nth 0 date) (nth 1 date))))) + (defun gnosis-calculate-e-factor (ef quality) "Calculate new e-factor given existing EF and binary QUALITY, 0 or 1." (cond |