aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-time-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-time-utils.c')
-rw-r--r--e-util/e-time-utils.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/e-util/e-time-utils.c b/e-util/e-time-utils.c
index 130dc738a0..e466c680bc 100644
--- a/e-util/e-time-utils.c
+++ b/e-util/e-time-utils.c
@@ -55,15 +55,10 @@ e_time_parse_date_and_time (const char *value,
pos = value;
- /* Skip any whitespace. */
- while (isspace (*pos))
+ /* Skip everything up to the first digit. */
+ while (!isdigit (*pos))
pos++;
- /* Skip any weekday name, full or abbreviated. */
- parse_end = strptime (pos, "%a ", &discard_tm);
- if (parse_end)
- pos = parse_end;
-
memset (result, 0, sizeof (*result));
/* strptime format for a date. */
parse_end = strptime (pos, _("%m/%d/%Y"), result);
@@ -72,25 +67,19 @@ e_time_parse_date_and_time (const char *value,
parsed_date = TRUE;
}
- /* Skip any whitespace. */
- while (isspace (*pos))
+ /* FIXME: Skip everything up to the first digit. I hope the am/pm flag
+ never gets entered first - it does in Japanese, so fix this. */
+ while (!isdigit (*pos))
pos++;
- /* Skip any weekday name, full or abbreviated, again. */
- parse_end = strptime (pos, "%a ", &discard_tm);
- if (parse_end)
- pos = parse_end;
-
- /* strptime format for a time of day, in 12-hour format.
- If it is not appropriate in the locale set to an empty string. */
+ /* strptime format for a time of day, in 12-hour format. */
format[0] = _("%I:%M:%S %p");
/* strptime format for a time of day, in 24-hour format. */
format[1] = _("%H:%M:%S");
- /* strptime format for time of day, without seconds, 12-hour format.
- If it is is not appropriate in the locale set to an empty string. */
+ /* strptime format for time of day, without seconds, 12-hour format. */
format[2] = _("%I:%M %p");
/* strptime format for time of day, without seconds 24-hour format. */