From 5a7f580cd11680c9a6784adecee3977480b71d23 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sun, 10 Jan 2021 01:14:30 -0500 Subject: Timezones and meeting --- 2020/organizers-notebook.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to '2020/organizers-notebook.md') diff --git a/2020/organizers-notebook.md b/2020/organizers-notebook.md index 5ccc5d0b..dfb9b719 100644 --- a/2020/organizers-notebook.md +++ b/2020/organizers-notebook.md @@ -867,6 +867,44 @@ and run like this: `fix.py # Other useful tidbits +## Translating timezones + + (setq my/timezones '("America/Toronto" "America/Los_Angeles" "UTC" "Europe/Berlin" "Asia/Kolkata" "Asia/Shanghai" "Asia/Singapore")) + (defun my/summarize-times (time timezones) + (let (prev-day) + (mapconcat + (lambda (tz) + (let ((cur-day (format-time-string "%a %b %-e" time tz)) + (cur-time (format-time-string "%H%MH %Z" time tz))) + (if (equal prev-day cur-day) + cur-time + (setq prev-day cur-day) + (concat cur-day " " cur-time)))) + (sort timezones (lambda (a b) (< (car (current-time-zone nil a)) (car (current-time-zone nil b))))) + " / "))) + (defun my/org-summarize-event-in-timezones () + (interactive) + (save-window-excursion + (save-excursion + (when (derived-mode-p 'org-agenda-mode) (org-agenda-goto)) + (when (re-search-forward org-element--timestamp-regexp nil (save-excursion (org-end-of-subtree) (point))) + (goto-char (match-beginning 0)) + (let* ((times (org-element-timestamp-parser)) + (start-time (org-timestamp-to-time (org-timestamp-split-range times))) + (msg (format "%s - %s - %s" + (org-get-heading t t t t) + (my/summarize-times start-time my/timezones) + ;; (cond + ;; ((time-less-p (org-timestamp-to-time (org-timestamp-split-range times t)) (current-time)) + ;; "(past)") + ;; ((time-less-p (current-time) start-time) + ;; (concat "in " (format-seconds "%D %H %M%Z" (time-subtract start-time (current-time))))) + ;; (t "(ongoing)")) + (org-entry-get (point) "LOCATION")))) + (message "%s" msg) + (kill-new msg)))))) + + ## Restarting ikiwiki manually This is needed when you change the template or if the ikiwiki process gets stuck on something. -- cgit v1.2.3