Skip to content

Commit 57d64cf

Browse files
committed
Date/time prompt: Allow input of relative time in hours (e.g. +1h)
* lisp/org.el (org-read-date-analyze): Match relative hour specifier. Fixes https://orgmode.org/list/C9A76EFA-1D76-4C5D-941D-AFA288A64CD0@icloud.com
1 parent d9963c5 commit 57d64cf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lisp/org.el

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13684,10 +13684,14 @@ user."
1368413684
(unless deltadef
1368513685
(let ((now (decode-time)))
1368613686
(setq day (nth 3 now) month (nth 4 now) year (nth 5 now))))
13687-
(cond ((member deltaw '("d" "")) (setq day (+ day deltan)))
13688-
((equal deltaw "w") (setq day (+ day (* 7 deltan))))
13689-
((equal deltaw "m") (setq month (+ month deltan)))
13690-
((equal deltaw "y") (setq year (+ year deltan)))))
13687+
(cond ((member deltaw '("h" ""))
13688+
(when (boundp 'org-time-was-given)
13689+
(setq org-time-was-given t))
13690+
(setq hour (+ hour deltan)))
13691+
((member deltaw '("d" "")) (setq day (+ day deltan)))
13692+
((equal deltaw "w") (setq day (+ day (* 7 deltan))))
13693+
((equal deltaw "m") (setq month (+ month deltan)))
13694+
((equal deltaw "y") (setq year (+ year deltan)))))
1369113695
((and wday (not (nth 3 tl)))
1369213696
;; Weekday was given, but no day, so pick that day in the week
1369313697
;; on or after the derived date.

0 commit comments

Comments
 (0)