summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.c22
-rw-r--r--src/custom.c13
2 files changed, 19 insertions, 16 deletions
diff --git a/src/config.c b/src/config.c
index 88d5acc..98e622a 100644
--- a/src/config.c
+++ b/src/config.c
@@ -204,16 +204,14 @@ config_parse_calendar_view (void *dummy, const char *val)
static int
config_parse_first_day_of_week (void *dummy, const char *val)
{
- unsigned tmp;
- if (config_parse_bool (&tmp, val)) {
- if (tmp)
- calendar_set_first_day_of_week (MONDAY);
- else
- calendar_set_first_day_of_week (SUNDAY);
- return 1;
- }
+ if (!strcmp (val, "monday"))
+ calendar_set_first_day_of_week (MONDAY);
+ else if (!strcmp (val, "sunday"))
+ calendar_set_first_day_of_week (SUNDAY);
else
return 0;
+
+ return 1;
}
static int
@@ -381,8 +379,12 @@ config_serialize_calendar_view (char *buf, void *dummy)
static int
config_serialize_first_day_of_week (char *buf, void *dummy)
{
- unsigned tmp = calendar_week_begins_on_monday ();
- return config_serialize_bool (buf, &tmp);
+ if (calendar_week_begins_on_monday ())
+ strcpy(buf, "monday");
+ else
+ strcpy(buf, "sunday");
+
+ return 1;
}
static int
diff --git a/src/custom.c b/src/custom.c
index dab05d0..017136d 100644
--- a/src/custom.c
+++ b/src/custom.c
@@ -630,7 +630,7 @@ print_general_options (WINDOW *win)
CONFIRM_DELETE,
SYSTEM_DIAGS,
PROGRESS_BAR,
- WEEK_BEGINS_MONDAY,
+ FIRST_DAY_OF_WEEK,
OUTPUT_DATE_FMT,
INPUT_DATE_FMT,
NB_OPTIONS
@@ -700,12 +700,13 @@ print_general_options (WINDOW *win)
_("(if set to YES, progress bar will be displayed "
"when saving data)"));
y += YOFF;
- mvwprintw (win, y, XPOS, "[8] %s ", opt[WEEK_BEGINS_MONDAY]);
- print_bool_option_incolor (win, calendar_week_begins_on_monday (), y,
- XPOS + 4 + strlen (opt[WEEK_BEGINS_MONDAY]));
+ mvwprintw (win, y, XPOS, "[8] %s ", opt[FIRST_DAY_OF_WEEK]);
+ custom_apply_attr (win, ATTR_HIGHEST);
+ mvwprintw (win, y, XPOS + 4 + strlen (opt[FIRST_DAY_OF_WEEK]), "%s",
+ calendar_week_begins_on_monday () ? _("Monday") : _("Sunday"));
+ custom_remove_attr (win, ATTR_HIGHEST);
mvwprintw (win, y + 1, XPOS,
- _("(if set to YES, monday is the first day of the week, "
- "else it is sunday)"));
+ _("(specifies the first day of week in the calendar view)"));
y += YOFF;
mvwprintw (win, y, XPOS, "[9] %s ", opt[OUTPUT_DATE_FMT]);
custom_apply_attr (win, ATTR_HIGHEST);