From 1e7f47df29053c2a197ee4a143f6ea198167b4fc Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Tue, 26 Sep 2023 12:59:10 -0400 Subject: Recognize multiple time constraints --- emacsconf-schedule.el | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'emacsconf-schedule.el') diff --git a/emacsconf-schedule.el b/emacsconf-schedule.el index 644d818..885cada 100644 --- a/emacsconf-schedule.el +++ b/emacsconf-schedule.el @@ -642,11 +642,17 @@ Both start and end time are tested." (defun emacsconf-schedule-get-time-constraint (o) (unless (string-match "after the event" (or (plist-get o :q-and-a) "")) (let ((avail (or (plist-get o :availability) "")) - hours) - (when (string-match "\\([<>]\\)=? *\\([0-9]+:[0-9]+\\) *EST" avail) - (if (string= (match-string 1 avail) ">") - (list (match-string 2 avail) nil) - (list nil (match-string 2 avail))))))) + hours + start + (pos 0) + (result (list nil nil))) + (while (string-match "\\([<>]\\)=? *\\([0-9]+:[0-9]+\\) *EST" avail pos) + (setf (elt result (if (string= (match-string 1 avail) ">") + 0 + 1)) + (match-string 2 avail)) + (setq pos (match-end 0))) + result))) (defun emacsconf-schedule-validate-all-talks-present (sched &optional list) (let* ((sched-slugs (mapcar (lambda (o) (plist-get o :slug)) -- cgit v1.2.3