branch: externals-release/org
commit 9c79aedec74d6a7da65d20f5356f54fd2fc32770
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>
org-agenda: Use more machine-friendly date output for csv export
* lisp/org-agenda.el (org-fix-agenda-info): Pad the month and date
numbers with 0, making sure that the date format is always YYYY-MM-DD.
Reported-by: David O'Toole <[email protected]>
Link:
https://orgmode.org/list/CAAz1J52e7ha=rtyz=Kn=o-x48xu3onjyf57xo5hobnz8_tw...@mail.gmail.com
---
lisp/org-agenda.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index eda2489384..d31391d11d 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3477,14 +3477,14 @@ This ensures the export commands can easily use it."
(setq props (plist-put props 'tags (mapconcat #'identity tmp ":"))))
(when (setq tmp (plist-get props 'date))
(when (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp)))
- (let ((calendar-date-display-form '(year "-" month "-" day)))
- '((format "%4d, %9s %2s, %4s" dayname monthname day year))
-
+ (let ((calendar-date-display-form
+ '(year "-" (string-pad month 2 ?0 'left) "-" (string-pad day 2 ?0
'left))))
(setq tmp (calendar-date-string tmp)))
(setq props (plist-put props 'date tmp)))
(when (setq tmp (plist-get props 'day))
(when (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp)))
- (let ((calendar-date-display-form '(year "-" month "-" day)))
+ (let ((calendar-date-display-form
+ '(year "-" (string-pad month 2 ?0 'left) "-" (string-pad day 2 ?0
'left))))
(setq tmp (calendar-date-string tmp)))
(setq props (plist-put props 'day tmp))
(setq props (plist-put props 'agenda-day tmp)))