forked from mirrors/org-cv
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))
|
date_str))
|
||||||
|
|
||||||
(defun org-cv-utils--format-time-window (from-date to-date)
|
(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
|
FROM-DATE -- TO-DATE
|
||||||
in case TO-DATE is nil return Present"
|
in case TO-DATE is nil return Present.
|
||||||
(concat
|
If both dates are the same, return just FROM-DATE"
|
||||||
(org-cv-utils-org-timestamp-to-shortdate from-date)
|
(let ((from (when from-date (org-cv-utils-org-timestamp-to-shortdate from-date)))
|
||||||
" -- "
|
(to (if (not to-date) "Present"
|
||||||
(if (not to-date) "Present"
|
(org-cv-utils-org-timestamp-to-shortdate to-date))))
|
||||||
(org-cv-utils-org-timestamp-to-shortdate to-date))))
|
|
||||||
|
(if from
|
||||||
|
(if (string= from to)
|
||||||
|
from
|
||||||
|
(concat from " -- " to))
|
||||||
|
"")))
|
||||||
|
|
||||||
(provide 'org-cv-utils)
|
(provide 'org-cv-utils)
|
||||||
;;; org-cv-utils ends here
|
;;; org-cv-utils ends here
|
||||||
|
|
Loading…
Reference in a new issue