mirror of
https://gitlab.com/Titan-C/org-cv.git
synced 2024-11-24 15:08:34 +00:00
Updated org-cv-utils--format-time-window
If both dates are the same, return only one of them, without the dash.
This commit is contained in:
parent
dcbe20b52d
commit
91e5a55fe1
1 changed files with 12 additions and 7 deletions
|
@ -45,14 +45,19 @@ today => today"
|
|||
date_str))
|
||||
|
||||
(defun org-cv-utils--format-time-window (from-date to-date)
|
||||
"Join date strings in a time window.
|
||||
"Join date strings in a time window.
|
||||
FROM-DATE -- TO-DATE
|
||||
in case TO-DATE is nil return Present"
|
||||
(concat
|
||||
(org-cv-utils-org-timestamp-to-shortdate from-date)
|
||||
" -- "
|
||||
(if (not to-date) "Present"
|
||||
in case TO-DATE is nil return Present.
|
||||
If both dates are the same, return just FROM-DATE"
|
||||
(let ((from (when from-date (org-cv-utils-org-timestamp-to-shortdate from-date)))
|
||||
(to (if (not to-date) "Present"
|
||||
(org-cv-utils-org-timestamp-to-shortdate to-date))))
|
||||
|
||||
(if from
|
||||
(if (string= from to)
|
||||
from
|
||||
(concat from " -- " to))
|
||||
"")))
|
||||
|
||||
(provide 'org-cv-utils)
|
||||
;;; org-cv-utils ends here
|
||||
|
|
Loading…
Reference in a new issue