views/dazzling: Detect week changes, not months

The new month view operates on weeks
This commit is contained in:
Georges Basile Stavracas Neto
2023-08-11 15:13:44 -03:00
parent d2c606a221
commit c2b07a5e0a
+6 -6
View File
@@ -726,18 +726,18 @@ gcal_dazzling_month_view_set_date (GcalView *view,
GDateTime *date)
{
GcalDazzlingMonthView *self;
gboolean month_changed;
gboolean week_changed;
GCAL_ENTRY;
self = GCAL_DAZZLING_MONTH_VIEW (view);
month_changed = !self->date ||
!date ||
g_date_time_get_month (self->date) != g_date_time_get_month (date) ||
g_date_time_get_year (self->date) != g_date_time_get_year (date);
week_changed = !self->date ||
!date ||
g_date_time_get_month (self->date) != g_date_time_get_month (date) ||
g_date_time_get_week_of_year (self->date) != g_date_time_get_week_of_year (date);
if (!month_changed)
if (!week_changed)
GCAL_RETURN ();
#ifdef GCAL_ENABLE_TRACE