Do not localize dates in pcal exports
* Do not localize the word "week" in pcal export headers. * Reset current locale before formatting dates in pcal export data. Addresses BUG#1. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
162b871682
commit
b4cefe2db9
2
src/io.c
2
src/io.c
@ -323,7 +323,7 @@ pcal_export_header (FILE *stream)
|
|||||||
calendar_week_begins_on_monday () ?
|
calendar_week_begins_on_monday () ?
|
||||||
"Monday" : "Sunday");
|
"Monday" : "Sunday");
|
||||||
(void)fprintf (stream, "# Display week number (i.e. 1-52) on every Monday\n");
|
(void)fprintf (stream, "# Display week number (i.e. 1-52) on every Monday\n");
|
||||||
(void)fprintf (stream, "all monday in all %s %%w\n", _("Week"));
|
(void)fprintf (stream, "all monday in all week %%w\n");
|
||||||
(void)fprintf (stream, "\n");
|
(void)fprintf (stream, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,8 +488,15 @@ date_sec2date_str (long sec, char *datefmt)
|
|||||||
void
|
void
|
||||||
date_sec2date_fmt (long sec, const char *fmt, char *datef)
|
date_sec2date_fmt (long sec, const char *fmt, char *datef)
|
||||||
{
|
{
|
||||||
|
/* TODO: Find a better way to deal with localization and strftime(). */
|
||||||
|
char *locale_old = mem_strdup (setlocale (LC_ALL, NULL));
|
||||||
|
setlocale (LC_ALL, "C");
|
||||||
|
|
||||||
struct tm *lt = localtime ((time_t *)&sec);
|
struct tm *lt = localtime ((time_t *)&sec);
|
||||||
strftime (datef, BUFSIZ, fmt, lt);
|
strftime (datef, BUFSIZ, fmt, lt);
|
||||||
|
|
||||||
|
setlocale (LC_ALL, locale_old);
|
||||||
|
mem_free (locale_old);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user