From cc6f3869c31eac6a3f97d6ec971c0f9b16419f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Sun, 8 Nov 2026 19:08:26 +0100 Subject: [PATCH] Name the weekday numbers --- magit-standup.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/magit-standup.el b/magit-standup.el index 847f710..772588e 100644 --- a/magit-standup.el +++ b/magit-standup.el @@ -98,6 +98,12 @@ back to Friday (3 days), otherwise look back 1 day." (defconst magit-standup--buffer-name "*magit-standup*") +(defconst magit-standup--friday 5 + "The ISO 8601 number of Friday, as `format-time-string' \"%u\" gives it.") + +(defconst magit-standup--saturday 6 + "The ISO 8601 number of Saturday, as `format-time-string' \"%u\" gives it.") + (defun magit-standup--since-date () "Return the \"since\" date string for filtering commits. If `magit-standup-since-days-ago' is set, use it. Otherwise, @@ -106,7 +112,8 @@ on weekends look back to Friday; on Monday look back to Friday (let* ((now (current-time)) (day (string-to-number (format-time-string "%u" now))) (days-ago (cond (magit-standup-since-days-ago magit-standup-since-days-ago) - ((<= 6 day) (- day 5)) + ((<= magit-standup--saturday day) + (- day magit-standup--friday)) ((= 1 day) 3) (t 1)))) (format-time-string "%Y-%m-%d"