summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-10-03 20:39:25 -0400
committerSacha Chua <sacha@sachachua.com>2022-10-03 20:39:25 -0400
commit7bf66eaa82f28c4b1c03157a36d8d697aa74637c (patch)
tree422ff2dbbea624a967276051034280cd12a8f00f
parentb34ea8e0779dade644fd3ef9b26da83dc89a9be7 (diff)
downloademacsconf-el-7bf66eaa82f28c4b1c03157a36d8d697aa74637c.tar.xz
emacsconf-el-7bf66eaa82f28c4b1c03157a36d8d697aa74637c.zip
Handle hh:mm
-rw-r--r--emacsconf-schedule.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/emacsconf-schedule.el b/emacsconf-schedule.el
index 61cb617..9d17ace 100644
--- a/emacsconf-schedule.el
+++ b/emacsconf-schedule.el
@@ -126,7 +126,8 @@ Each function should take the info and manipulate it as needed, returning the ne
(defun emacsconf-schedule-inflate-sexp (sequence &optional info include-time)
"Pairs with `emacsconf-schedule-dump-sexp'."
(setq info (or info (emacsconf-get-talk-info)))
- (let ((by-assoc (mapcar (lambda (o) (cons (intern (plist-get o :slug)) o)) (emacsconf-filter-talks info))))
+ (let ((by-assoc (mapcar (lambda (o) (cons (intern (plist-get o :slug)) o)) (emacsconf-filter-talks info)))
+ date)
(mapcar
(lambda (seq)
(if include-time
@@ -137,6 +138,9 @@ Each function should take the info and manipulate it as needed, returning the ne
((eq seq 'lunch)
(list :title "LUNCH" :time emacsconf-schedule-lunch-time))
((and (listp seq) (member (car seq) '(break lunch)) (stringp (cdr seq)))
+ (if (string-match "-" (cdr seq))
+ (setq date (format-time-string "%Y-%m-%d" (date-to-time (cdr seq))))
+ (setcdr seq (concat date " " (cdr seq))))
(list :title (if (eq (car seq) 'lunch) "LUNCH" "BREAK")
:scheduled (format-time-string (cdr org-time-stamp-formats) (date-to-time (cdr seq)))
:start-time (date-to-time (cdr seq))
@@ -147,6 +151,9 @@ Each function should take the info and manipulate it as needed, returning the ne
:time (string-to-number (cdr seq))))
;; Named thing with fixed time
((and (listp seq) (stringp (car seq)) (stringp (cdr seq)))
+ (if (string-match "-" (cdr seq))
+ (setq date (format-time-string "%Y-%m-%d" (date-to-time (cdr seq))))
+ (setcdr seq (concat date " " (cdr seq))))
(append
(list :title (car seq)
:scheduled (format-time-string (car org-time-stamp-formats) (date-to-time (cdr seq)))
@@ -166,6 +173,9 @@ Each function should take the info and manipulate it as needed, returning the ne
(list :title seq)))
;; Slug with time
((and (listp seq) (symbolp (car seq)) (stringp (cdr seq)))
+ (if (string-match "-" (cdr seq))
+ (setq date (format-time-string "%Y-%m-%d" (date-to-time (cdr seq))))
+ (setcdr seq (concat date " " (cdr seq))))
(append (list :scheduled (format-time-string (cdr org-time-stamp-formats) (date-to-time (cdr seq)))
:start-time (date-to-time (cdr seq))
:fixed-time t)