path: root/src/calcurse.h
diff options
authorMorgan Seltzer <MorganSeltzer000@gmail.com>2021-06-07 17:13:23 -0400
committerLukas Fleischer <lfleischer@calcurse.org>2021-08-07 13:42:10 -0400
commite3fc73e0c76addc0893ad3ceeba7ef8442133a51 (patch)
tree16f5fe4e89f5ace43471754c170c936bc9103f4c /src/calcurse.h
parent61ed5f835cae29ce6405ec34a7e310d5ea90327b (diff)
Backend changes for first day of week
Previously only Sunday and Monday were allowed for the first day of the week, and was internally treated as a binary variable. This patch changes the backend so all days are accepted, a future patch will allow users to actually select other days. 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/calcurse.h')
1 files changed, 4 insertions, 2 deletions
diff --git a/src/calcurse.h b/src/calcurse.h
index 8d9e3d8..db8dd51 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -152,7 +152,7 @@
* The argument (d) is the "Sunday"-numbering of member tm_wday in struct tm.
#define WDAY(d) \
- (ui_calendar_week_begins_on_monday() ? ((d ? d : WEEKINDAYS) - 1) : d)
+ (modify_wday(d, -ui_calendar_get_wday_start()))
/* Key definitions. */
#define CTRLVAL 0x1F
@@ -811,7 +811,7 @@ void ui_calendar_set_current_date(void);
struct date *ui_calendar_get_today(void);
void ui_calendar_set_first_day_of_week(enum wday);
void ui_calendar_change_first_day_of_week(void);
-unsigned ui_calendar_week_begins_on_monday(void);
+int ui_calendar_get_wday_start(void);
void ui_calendar_store_current_date(struct date *);
void ui_calendar_init_slctd_day(void);
struct date *ui_calendar_get_slctd_day(void);
@@ -1234,6 +1234,8 @@ time_t date_sec_change(time_t, int, int);
time_t update_time_in_date(time_t, unsigned, unsigned);
time_t get_sec_date(struct date);
long min2sec(unsigned);
+int modify_wday(int,int);
+char *get_wday_default_string(int);
void draw_scrollbar(struct scrollwin *, int);
void item_in_popup(const char *, const char *, const char *, const char *);
time_t get_today(void);