aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-time-utils.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-09-01 08:14:01 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-09-01 08:14:01 +0800
commite137371494ac61c6dc94cb58ee35a5d2ef0a0123 (patch)
tree5148493d3cf9b2a11cc40d0e3532c05169a6c868 /e-util/e-time-utils.c
parentc99e5be2fdb58835e6be75b5e975c493228cc639 (diff)
downloadgsoc2013-evolution-e137371494ac61c6dc94cb58ee35a5d2ef0a0123.tar.gz
gsoc2013-evolution-e137371494ac61c6dc94cb58ee35a5d2ef0a0123.tar.zst
gsoc2013-evolution-e137371494ac61c6dc94cb58ee35a5d2ef0a0123.zip
Added format for "7 PM" and equivalents. Fixes bug #7456.
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. svn path=/trunk/; revision=12549
Diffstat (limited to 'e-util/e-time-utils.c')
-rw-r--r--e-util/e-time-utils.c14
1 files changed, 10 insertions, 4 deletions
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]));
}