From badc11edcf5e73bc6148c7b5cdccee739eb9d7ae Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 15 Nov 2011 19:45:29 +0100 Subject: Bug #661126 - Meeting Free/busy dialog dates don't follow locale --- e-util/e-datetime-format.c | 22 ++++++++++++++++++++++ e-util/e-datetime-format.h | 1 + 2 files changed, 23 insertions(+) (limited to 'e-util') diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c index c21d025794..877b170218 100644 --- a/e-util/e-datetime-format.c +++ b/e-util/e-datetime-format.c @@ -662,3 +662,25 @@ e_datetime_format_format_tm (const gchar *component, return res; } + +gboolean +e_datetime_format_includes_day_name (const gchar *component, const gchar *part, DTFormatKind kind) +{ + gchar *key; + const gchar *fmt; + gboolean res; + + g_return_val_if_fail (component != NULL, FALSE); + g_return_val_if_fail (*component != 0, FALSE); + + key = gen_key (component, part, kind); + g_return_val_if_fail (key != NULL, FALSE); + + fmt = get_format_internal (key, kind); + + res = fmt && (strstr (fmt, "%a") != NULL || strstr (fmt, "%A") != NULL); + + g_free (key); + + return res; +} diff --git a/e-util/e-datetime-format.h b/e-util/e-datetime-format.h index 2c19c65133..28eed151b3 100644 --- a/e-util/e-datetime-format.h +++ b/e-util/e-datetime-format.h @@ -39,6 +39,7 @@ void e_datetime_format_add_setup_widget (GtkWidget *table, gint row, const gchar gchar *e_datetime_format_format (const gchar *component, const gchar *part, DTFormatKind kind, time_t value); gchar *e_datetime_format_format_tm (const gchar *component, const gchar *part, DTFormatKind kind, struct tm *tm_time); +gboolean e_datetime_format_includes_day_name (const gchar *component, const gchar *part, DTFormatKind kind); G_END_DECLS -- cgit v1.2.3