aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);