From be26e5a85472707b2bc2b5cf65749f5172b4a0a2 Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Thu, 14 Jun 2001 06:04:20 +0000 Subject: skip any non-digits while looking for dates and times. This should fix 2001-06-11 Damon Chaplin * e-time-utils.c (e_time_parse_date_and_time): skip any non-digits while looking for dates and times. This should fix some translation problems. Though there is still a problem with Japanese, where the am/pm flag comes before the time so we will skip it incorrectly. svn path=/trunk/; revision=10224 --- e-util/e-time-utils.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'e-util/e-time-utils.c') 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. */ -- cgit v1.2.3