aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view-top-item.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/e-day-view-top-item.c')
-rw-r--r--calendar/gui/e-day-view-top-item.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index 0b8b65ad53..201d10394b 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -816,24 +816,31 @@ e_day_view_top_item_get_type (void)
}
void
-e_day_view_top_item_get_day_label (EDayView *day_view, gint day,
- gchar *buffer, gint buffer_len)
+e_day_view_top_item_get_day_label (EDayView *day_view,
+ gint day,
+ gchar *buffer,
+ gint buffer_len)
{
+ ECalendarView *view;
struct icaltimetype day_start_tt;
+ const icaltimezone *zone;
struct tm day_start = { 0 };
const gchar *format;
- day_start_tt = icaltime_from_timet_with_zone (day_view->day_starts[day],
- FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+ view = E_CALENDAR_VIEW (day_view);
+ zone = e_calendar_view_get_timezone (view);
+
+ day_start_tt = icaltime_from_timet_with_zone (
+ day_view->day_starts[day], FALSE, zone);
day_start.tm_year = day_start_tt.year - 1900;
day_start.tm_mon = day_start_tt.month - 1;
day_start.tm_mday = day_start_tt.day;
day_start.tm_isdst = -1;
- day_start.tm_wday = time_day_of_week (day_start_tt.day,
- day_start_tt.month - 1,
- day_start_tt.year);
+ day_start.tm_wday = time_day_of_week (
+ day_start_tt.day,
+ day_start_tt.month - 1,
+ day_start_tt.year);
if (day_view->date_format == E_DAY_VIEW_DATE_FULL)
/* strftime format %A = full weekday name, %d = day of month,