aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-06-14 14:04:20 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-06-14 14:04:20 +0800
commitbe26e5a85472707b2bc2b5cf65749f5172b4a0a2 (patch)
tree4e773d6eca2db1a334099675f47ddec3d85d3a05 /e-util
parent4517358debc8bcd761a469e901bae160704deaf2 (diff)
downloadgsoc2013-evolution-be26e5a85472707b2bc2b5cf65749f5172b4a0a2.tar
gsoc2013-evolution-be26e5a85472707b2bc2b5cf65749f5172b4a0a2.tar.gz
gsoc2013-evolution-be26e5a85472707b2bc2b5cf65749f5172b4a0a2.tar.bz2
gsoc2013-evolution-be26e5a85472707b2bc2b5cf65749f5172b4a0a2.tar.lz
gsoc2013-evolution-be26e5a85472707b2bc2b5cf65749f5172b4a0a2.tar.xz
gsoc2013-evolution-be26e5a85472707b2bc2b5cf65749f5172b4a0a2.tar.zst
gsoc2013-evolution-be26e5a85472707b2bc2b5cf65749f5172b4a0a2.zip
skip any non-digits while looking for dates and times. This should fix
2001-06-11 Damon Chaplin <damon@ximian.com> * 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
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog7
-rw-r--r--e-util/e-time-utils.c25
2 files changed, 14 insertions, 18 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 504bbfefa2..c22a4434ed 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,10 @@
+2001-06-11 Damon Chaplin <damon@ximian.com>
+
+ * 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.
+
2001-06-10 Damon Chaplin <damon@ximian.com>
* e-time-utils.c (e_time_parse_date_and_time):
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. */