From fc4306c44b681b6e8f956ebc2740002bdb66d266 Mon Sep 17 00:00:00 2001 From: Maxime Wack Date: Wed, 3 Feb 2021 12:51:20 +0100 Subject: [PATCH 1/3] Fix cfw:org-get-timerange to display the correct timerange --- calfw-org.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/calfw-org.el b/calfw-org.el index 4590f1c..5e0c039 100644 --- a/calfw-org.el +++ b/calfw-org.el @@ -238,12 +238,10 @@ If TEXT does not have a range, return nil." (match-string 1 extra))) (total-days (string-to-number (match-string 2 extra))) - (start-date (time-subtract - (org-read-date nil t date-string) - (seconds-to-time (* 3600 24 (- cur-day 1))))) + (start-date (org-read-date nil t date-string)) (end-date (time-add (org-read-date nil t date-string) - (seconds-to-time (* 3600 24 (- total-days cur-day)))))) + (seconds-to-time (* 3600 24 (- total-days 1)))))) (list (calendar-gregorian-from-absolute (time-to-days start-date)) (calendar-gregorian-from-absolute (time-to-days end-date)) text)) ))))) From 407b0eb31b1d16532e22316edfba5b0b76f4cd3b Mon Sep 17 00:00:00 2001 From: Maxime Wack Date: Mon, 7 Jun 2021 00:58:43 +0200 Subject: [PATCH 2/3] Re-use start-date, as permitted by let* --- calfw-org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calfw-org.el b/calfw-org.el index 5e0c039..6581d89 100644 --- a/calfw-org.el +++ b/calfw-org.el @@ -240,7 +240,7 @@ If TEXT does not have a range, return nil." (match-string 2 extra))) (start-date (org-read-date nil t date-string)) (end-date (time-add - (org-read-date nil t date-string) + start-date (seconds-to-time (* 3600 24 (- total-days 1)))))) (list (calendar-gregorian-from-absolute (time-to-days start-date)) (calendar-gregorian-from-absolute (time-to-days end-date)) text)) From 6c75fd3acb47f634d0b2c3c591e659c5bae448cc Mon Sep 17 00:00:00 2001 From: Maxime Wack Date: Mon, 7 Jun 2021 00:59:35 +0200 Subject: [PATCH 3/3] Fix the double displaying of timeranges with times --- calfw-org.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/calfw-org.el b/calfw-org.el index 6581d89..f098a76 100644 --- a/calfw-org.el +++ b/calfw-org.el @@ -242,8 +242,9 @@ If TEXT does not have a range, return nil." (end-date (time-add start-date (seconds-to-time (* 3600 24 (- total-days 1)))))) - (list (calendar-gregorian-from-absolute (time-to-days start-date)) - (calendar-gregorian-from-absolute (time-to-days end-date)) text)) + (unless (= cur-day total-days) + (list (calendar-gregorian-from-absolute (time-to-days start-date)) + (calendar-gregorian-from-absolute (time-to-days end-date)) text))) ))))) (defun cfw:org-schedule-period-to-calendar (begin end)