diff --git a/doc/org.texi b/doc/org.texi index a257f29af..9b2c6a2f7 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -5875,7 +5875,7 @@ in @b{bold}. 14 @result{} @b{2006}-@b{06}-14 12 @result{} @b{2006}-@b{07}-12 2/5 @result{} @b{2007}-02-05 -Fri @result{} nearest Friday (default date or later) +Fri @result{} nearest Friday after the default date sep 15 @result{} @b{2006}-09-15 feb 15 @result{} @b{2007}-02-15 sep 12 9 @result{} 2009-09-12 @@ -5900,7 +5900,8 @@ the abbreviation of day name, the date will be the Nth such day, e.g.: +4 @result{} same as above +2w @result{} two weeks from today ++5 @result{} five days from default date -+2tue @result{} second Tuesday from now. ++2tue @result{} second Tuesday from now +-wed @result{} last Wednesday @end example @vindex parse-time-months diff --git a/lisp/org.el b/lisp/org.el index bbbeb7afe..cf5c9a96a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16141,7 +16141,8 @@ mean next year. For details, see the manual. A few examples: 12:45 --> today 12:45 22 sept 0:34 --> currentyear-09-22 0:34 12 --> currentyear-currentmonth-12 - Fri --> nearest Friday (today or later) + Fri --> nearest Friday after today + -Tue --> last Tuesday etc. Furthermore you can specify a relative date by giving, as the *first* thing @@ -16529,7 +16530,12 @@ DEF-FLAG is t when a double ++ or -- indicates shift relative to (if wday1 (progn (setq delta (mod (+ 7 (- wday1 wday)) 7)) - (if (= dir ?-) (setq delta (- delta 7))) + (if (= delta 0) (setq delta 7)) + (if (= dir ?-) + (progn + (setq delta (- delta 7)) + (if (= delta 0) (setq delta -7)) + )) (if (> n 1) (setq delta (+ delta (* (1- n) (if (= dir ?-) -7 7))))) (list delta "d" rel)) (list (* n (if (= dir ?-) -1 1)) what rel)))))