summaryrefslogtreecommitdiffstats
path: root/2020/organizers-notebook.md
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2021-01-10 01:14:30 -0500
committerSacha Chua <sacha@sachachua.com>2021-01-10 01:14:30 -0500
commit5a7f580cd11680c9a6784adecee3977480b71d23 (patch)
treefb49e3a35ba1cd4431fce6fa5cae448c02aa5541 /2020/organizers-notebook.md
parent329bfddecb93b4032fffb8858d98d13bc66930ef (diff)
downloademacsconf-wiki-5a7f580cd11680c9a6784adecee3977480b71d23.tar.xz
emacsconf-wiki-5a7f580cd11680c9a6784adecee3977480b71d23.zip
Timezones and meeting
Diffstat (limited to '2020/organizers-notebook.md')
-rw-r--r--2020/organizers-notebook.md38
1 files changed, 38 insertions, 0 deletions
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 <subtitles/fix.py> 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.