aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Williams <peterw@ximian.com>2001-08-14 00:29:39 +0800
committerPeter Williams <peterw@src.gnome.org>2001-08-14 00:29:39 +0800
commitaa689325b2247e6b7afdab9a535506d18e479606 (patch)
treef2d542a54db0dffdc2a39498a9992d5495c0f605
parent99a9e24304f87ad01a23d670d03644c924a8f121 (diff)
downloadgsoc2013-evolution-aa689325b2247e6b7afdab9a535506d18e479606.tar
gsoc2013-evolution-aa689325b2247e6b7afdab9a535506d18e479606.tar.gz
gsoc2013-evolution-aa689325b2247e6b7afdab9a535506d18e479606.tar.bz2
gsoc2013-evolution-aa689325b2247e6b7afdab9a535506d18e479606.tar.lz
gsoc2013-evolution-aa689325b2247e6b7afdab9a535506d18e479606.tar.xz
gsoc2013-evolution-aa689325b2247e6b7afdab9a535506d18e479606.tar.zst
gsoc2013-evolution-aa689325b2247e6b7afdab9a535506d18e479606.zip
New function. Convert a time_t to a gchar * (with i18n) (describe_button):
2001-08-13 Peter Williams <peterw@ximian.com> * filter-datespec.c (format_time): New function. Convert a time_t to a gchar * (with i18n) (describe_button): Use format_time instead of ctime. svn path=/trunk/; revision=11942
-rw-r--r--filter/ChangeLog2
-rw-r--r--filter/filter-datespec.c17
2 files changed, 17 insertions, 2 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 099de774ee..02ef3cb122 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -2,6 +2,8 @@
* filter-datespec.c (make_span_editor): Add a gettext around our static
strings.
+ (format_time): New function. Convert a time_t to a gchar * (with i18n)
+ (describe_button): Use format_time instead of ctime.
2001-08-10 Peter Williams <peterw@ximian.com>
diff --git a/filter/filter-datespec.c b/filter/filter-datespec.c
index fea81911a6..efc073a4d9 100644
--- a/filter/filter-datespec.c
+++ b/filter/filter-datespec.c
@@ -700,10 +700,23 @@ set_adjustments (FilterDatespec *fds)
}
static gchar *
+format_time (time_t time)
+{
+ struct tm *as_tm;
+ char buf[128];
+
+ /* no idea if this format is the 'correct' one */
+
+ as_tm = localtime (&time);
+ strftime (buf, 128, _("%b %d %l:%M %p"), as_tm);
+ return g_strdup (buf);
+}
+
+static gchar *
describe_button (FilterDatespec *fds)
{
gchar *desc = NULL;
-
+
switch (fds->type) {
case FDST_UNKNOWN:
desc = g_strdup (_("<click here to select a date>"));
@@ -712,7 +725,7 @@ describe_button (FilterDatespec *fds)
desc = g_strdup (_("now"));
break;
case FDST_SPECIFIED:
- desc = g_strdup (ctime (&(fds->value)));
+ desc = format_time (fds->value);
break;
case FDST_X_AGO:
desc = stringify_agoness (fds);