From e06033910c9090a5a51956ab85c212d5a80d1b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Fri, 26 Sep 2014 12:26:22 -0400 Subject: [PATCH] utils: add print_date debug method --- src/gcal-utils.c | 14 ++++++++++++++ src/gcal-utils.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/src/gcal-utils.c b/src/gcal-utils.c index 1491da55..6c8ec17e 100644 --- a/src/gcal-utils.c +++ b/src/gcal-utils.c @@ -22,6 +22,7 @@ #include "gcal-event-widget.h" #include "gcal-view.h" +#include #include #include @@ -278,6 +279,19 @@ gcal_compare_event_widget_by_date (gconstpointer a, return icaltime_compare (*a_date, *b_date); } +void print_date (const gchar* prefix, + const icaltimetype* icaltime) +{ + gchar* temp = + isodate_from_time_t (icaltime_as_timet_with_zone (*icaltime, + icaltime->zone)); + g_debug ("%s: %s -- zone: %s", + prefix, + temp, + icaltimezone_get_display_name (icaltime->zone)); + g_free (temp); +} + /* Function to do a last minute fixup of the AM/PM stuff if the locale * and gettext haven't done it right. Most English speaking countries * except the USA use the 24 hour clock (UK, Australia etc). However diff --git a/src/gcal-utils.h b/src/gcal-utils.h index 598f5aad..b546151f 100644 --- a/src/gcal-utils.h +++ b/src/gcal-utils.h @@ -73,6 +73,9 @@ GdkPixbuf* gcal_get_pixbuf_from_color (GdkColor gint gcal_compare_event_widget_by_date (gconstpointer a, gconstpointer b); +void print_date (const gchar* prefix, + const icaltimetype* icaltime); + /* code brought from evolution */ gsize e_strftime_fix_am_pm (gchar *str, gsize max,