aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui-calendar.c
diff options
context:
space:
mode:
authorMorgan Seltzer <MorganSeltzer000@gmail.com>2021-06-07 18:11:43 -0400
committerLukas Fleischer <lfleischer@calcurse.org>2021-08-07 13:42:28 -0400
commitee8ebebf9210abaa7bb6e9accc3ceed3909c2f12 (patch)
tree63e50d382048cfd424f1997c9d573225f70fb21d /src/ui-calendar.c
parente3fc73e0c76addc0893ad3ceeba7ef8442133a51 (diff)
downloadcalcurse-ee8ebebf9210abaa7bb6e9accc3ceed3909c2f12.tar.gz
calcurse-ee8ebebf9210abaa7bb6e9accc3ceed3909c2f12.zip
First day of week can now be any day
Previously only Sunday and Monday were allowed as the first day of the week, and this was internally treated as a binary variable. This patch allows for users to change the first day of the week to any day. Addresses GitHub feature request #321. Signed-off-by: Morgan Seltzer <MorganSeltzer000@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/ui-calendar.c')
-rw-r--r--src/ui-calendar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ui-calendar.c b/src/ui-calendar.c
index e4d5289..f69ea4c 100644
--- a/src/ui-calendar.c
+++ b/src/ui-calendar.c
@@ -159,7 +159,9 @@ void ui_calendar_set_first_day_of_week(enum wday first_day)
/* Swap first day of week in calendar. */
void ui_calendar_change_first_day_of_week(void)
{
- wday_start = !wday_start;
+ wday_start++;
+ if(wday_start >= WEEKINDAYS)
+ wday_start = 0;
}
/* Return 1 if week begins on monday, 0 otherwise. */