aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-07-17 05:25:01 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-07-17 05:25:01 +0800
commitb3b1380f854e09cc4afe520053a930cd571696ef (patch)
treed21f66f8c42430cd5744077884d0bd5fb7931345
parent86b0cdbb0738cc8b188abad6429ef80d64c9ed0d (diff)
downloadgsoc2013-evolution-b3b1380f854e09cc4afe520053a930cd571696ef.tar.gz
gsoc2013-evolution-b3b1380f854e09cc4afe520053a930cd571696ef.tar.zst
gsoc2013-evolution-b3b1380f854e09cc4afe520053a930cd571696ef.zip
Fixes bug #2901.
2001-07-16 Federico Mena Quintero <federico@ximian.com> Fixes bug #2901. * e-dateedit.c (e_date_edit_parse_date): Use e_time_parse_date(). (e_date_edit_parse_time): Use e_time_parse_time(). svn path=/trunk/; revision=11137
-rw-r--r--widgets/misc/ChangeLog7
-rw-r--r--widgets/misc/e-dateedit.c19
2 files changed, 10 insertions, 16 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 9bb10ced0b..9d5b0ff4ab 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,10 @@
+2001-07-16 Federico Mena Quintero <federico@ximian.com>
+
+ Fixes bug #2901.
+
+ * e-dateedit.c (e_date_edit_parse_date): Use e_time_parse_date().
+ (e_date_edit_parse_time): Use e_time_parse_time().
+
2001-07-17 jacob berkman <jacob@ximian.com>
* e-search-bar.c (set_dropdown): don't unset _CAN_FOCUS
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index 6abd74eb71..88b6173da9 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -30,9 +30,6 @@
* time field with popups for entering a date.
*/
-/* We need this for strptime. */
-#define _XOPEN_SOURCE 4
-
#include <config.h>
#include "e-dateedit.h"
@@ -60,6 +57,7 @@
#include <gtk/gtkvbox.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include "e-util/e-time-utils.h"
#include "e-calendar.h"
@@ -1307,9 +1305,7 @@ e_date_edit_parse_date (EDateEdit *dedit,
struct tm *tmp_tm;
time_t t;
- /* This is a strptime() format for a short date. %m = month,
- %d = day of month, %Y = year (all digits). */
- if (!strptime (date_text, _("%m/%d/%Y"), date_tm))
+ if (e_time_parse_date (date_text, date_tm) != E_TIME_PARSE_OK)
return FALSE;
/* If the user entered a 2-digit year we use the current century. */
@@ -1333,22 +1329,13 @@ e_date_edit_parse_time (EDateEdit *dedit,
gchar *time_text,
struct tm *time_tm)
{
- gchar *format;
-
if (field_set_to_none (time_text)) {
time_tm->tm_hour = 0;
time_tm->tm_min = 0;
return TRUE;
}
- if (dedit->priv->use_24_hour_format)
- /* This is a strptime() format. %H = hour (0-23), %M = minute. */
- format = _("%H:%M");
- else
- /* This is a strptime() format. %I = hour (1-12), %M = minute, %p = am/pm string. */
- format = _("%I:%M %p");
-
- if (!strptime (time_text, format, time_tm))
+ if (e_time_parse_time (time_text, time_tm) != E_TIME_PARSE_OK)
return FALSE;
return TRUE;