aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--e-util/ChangeLog6
-rw-r--r--e-util/e-time-utils.c14
2 files changed, 16 insertions, 4 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 409f7028c1..6672c30310 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,9 @@
+2001-08-31 Federico Mena Quintero <federico@ximian.com>
+
+ * e-time-utils.c (e_time_parse_date_and_time): Added format for
+ "7 PM" and equivalents. Fixes bug #7456.
+ (e_time_parse_time): Likewise.
+
2001-08-28 Not Zed <NotZed@Ximian.com>
* e-categories-master-list-wombat.c (ecmlw_load): Dont call
diff --git a/e-util/e-time-utils.c b/e-util/e-time-utils.c
index bb051986da..59650a31d3 100644
--- a/e-util/e-time-utils.c
+++ b/e-util/e-time-utils.c
@@ -65,7 +65,7 @@ e_time_parse_date_and_time (const char *value,
struct tm *today_tm;
time_t t;
const char *pos, *parse_end;
- char *format[4];
+ char *format[5];
gboolean parsed_date = FALSE, parsed_time = FALSE;
gint i;
@@ -104,8 +104,11 @@ e_time_parse_date_and_time (const char *value,
/* strptime format for time of day, without seconds, 12-hour format. */
format[2] = _("%I:%M %p");
+ /* strptime format for hour and AM/PM */
+ format[3] = _("%I %p");
+
/* strptime format for time of day, without seconds 24-hour format. */
- format[3] = _("%H:%M");
+ format[4] = _("%H:%M");
for (i = 0; i < sizeof (format) / sizeof (format[0]); i++) {
memset (&time_tm, 0, sizeof (time_tm));
@@ -267,7 +270,7 @@ e_time_parse_date (const char *value, struct tm *result)
ETimeParseStatus
e_time_parse_time (const char *value, struct tm *result)
{
- const char *format[4];
+ const char *format[5];
/* strptime format for a time of day, in 12-hour format.
If it is not appropriate in the locale set to an empty string. */
@@ -280,8 +283,11 @@ e_time_parse_time (const char *value, struct tm *result)
If it is is not appropriate in the locale set to an empty string. */
format[2] = _("%I:%M %p");
+ /* strptime format for hour and AM/PM */
+ format[3] = _("%I %p");
+
/* strptime format for time of day, without seconds 24-hour format. */
- format[3] = _("%H:%M");
+ format[4] = _("%H:%M");
return parse_with_strptime (value, result, format, sizeof (format) / sizeof (format[0]));
}