aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Monnet <quentin@isovalent.com>2022-07-18 10:38:57 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2022-07-20 09:58:43 +0200
commit815ced40d5c611dabb2a0ff258f8357e8b38384c (patch)
treeef89a5d02f5194ec7aa4e4841602b5cd0f811f8a
parente5f3693a567dbbdafb614f8254e225fbb50abced (diff)
downloadpw-815ced40d5c611dabb2a0ff258f8357e8b38384c.tar.gz
pw-schedule: Use locale-independent format for day of week
The test on the day of week uses "Monday" as a hardcoded value. Let's use a numerical value instead to avoid breaking on systems where the default locale is not English-based. Signed-off-by: Quentin Monnet <quentin@isovalent.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rwxr-xr-xpw-schedule4
1 files changed, 2 insertions, 2 deletions
diff --git a/pw-schedule b/pw-schedule
index bd7108b..09db874 100755
--- a/pw-schedule
+++ b/pw-schedule
@@ -62,9 +62,9 @@ schedule_dump_cover
for i in $(seq 0 1 $(expr $weeks - 1))
do
dev=${reviewer_sch[ $i % ${#reviewer[@]} ]}
- day=$(date --date "$rstart" '+%A')
+ day=$(date --date "$rstart" '+%w')
stride=2
- if [ "$day" = "Monday" ]; then
+ if [ "$day" = "1" ]; then # day 1 is Monday
stride=3
fi
rend=$(date --date "$rstart +$stride days" '+%m/%d/%Y')