Use our array of available date input formats

Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Baptiste Jonglez 2012-05-28 04:50:41 +02:00 committed by Lukas Fleischer
parent 9adacec623
commit f7a88a5515

View File

@ -687,8 +687,8 @@ static int print_general_options(WINDOW * win)
conf.input_datefmt); conf.input_datefmt);
custom_remove_attr(win, ATTR_HIGHEST); custom_remove_attr(win, ATTR_HIGHEST);
mvwaddstr(win, y + 1, XPOS, _("(Format to be used when entering a date: ")); mvwaddstr(win, y + 1, XPOS, _("(Format to be used when entering a date: "));
mvwaddstr(win, y + 2, XPOS, mvwprintw(win, y + 2, XPOS, " (1) %s, (2) %s, (3) %s, (4) %s)",
_(" (1)mm/dd/yyyy (2)dd/mm/yyyy (3)yyyy/mm/dd (4)yyyy-mm-dd)")); datefmt_str[0], datefmt_str[1], datefmt_str[2], datefmt_str[3]);
return y + YOFF; return y + YOFF;
} }
@ -715,12 +715,6 @@ void custom_general_config(void)
const char *output_datefmt_str = const char *output_datefmt_str =
_("Enter the date format (see 'man 3 strftime' for possible formats) "); _("Enter the date format (see 'man 3 strftime' for possible formats) ");
const char *input_datefmt_prefix = _("Enter the date format: "); const char *input_datefmt_prefix = _("Enter the date format: ");
const char *input_datefmt_choices[] = {
_("mm/dd/yyyy"),
_("dd/mm/yyyy"),
_("yyyy/mm/dd"),
_("yyyy-mm-dd")
};
const char *periodic_save_str = const char *periodic_save_str =
_("Enter the delay, in minutes, between automatic saves (0 to disable) "); _("Enter the delay, in minutes, between automatic saves (0 to disable) ");
int ch; int ch;
@ -791,8 +785,7 @@ void custom_general_config(void)
break; break;
case '0': case '0':
val = status_ask_simplechoice(input_datefmt_prefix, val = status_ask_simplechoice(input_datefmt_prefix,
input_datefmt_choices, datefmt_str, DATE_FORMATS);
DATE_FORMATS);
if (val != -1) if (val != -1)
conf.input_datefmt = val; conf.input_datefmt = val;
break; break;