summaryrefslogtreecommitdiff
path: root/src/vars.c
diff options
context:
space:
mode:
authorBaptiste Jonglez <baptiste--git@jonglez.org>2012-05-28 04:50:40 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-05-31 20:42:23 +0200
commit9adacec623d4cca07844e1667c7d0a8d3179a261 (patch)
tree9c266918962ee253285595dca53a9bc68bf7f8cb /src/vars.c
parent9e1185f526e4a6636a64b026c6617898a6a1c8aa (diff)
downloadcalcurse-9adacec623d4cca07844e1667c7d0a8d3179a261.zip
Provide an array of available date input formats
This will allow to fix the current hardcoding of strings describing date input formats in multiple places. Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/vars.c')
-rw-r--r--src/vars.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vars.c b/src/vars.c
index dd4cfbc..b6bddcb 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -61,6 +61,9 @@ enum ui_mode ui_mode = UI_CMDLINE;
/* Don't save anything if this is set. */
int read_only = 0;
+/* Strings describing each input date format. */
+const char *datefmt_str[DATE_FORMATS];
+
/*
* variables to store calendar names
*/
@@ -136,6 +139,11 @@ void vars_init(void)
strncpy(conf.output_datefmt, "%D", 3);
conf.input_datefmt = 1;
+ datefmt_str[0] = _("mm/dd/yyyy");
+ datefmt_str[1] = _("dd/mm/yyyy");
+ datefmt_str[2] = _("yyyy/mm/dd");
+ datefmt_str[3] = _("yyyy-mm-dd");
+
/* Default external editor and pager */
ed = getenv("VISUAL");
if (ed == NULL || ed[0] == '\0')