gcal_schedule_section_day_changed() - Use the original dates
The original code from commit 10234653 is
GCAL_RETURN (gcal_date_time_compare_date (start_date, gcal_event_get_date_start (self->event)) < 0 ||
gcal_date_time_compare_date (end_date, gcal_event_get_date_end (self->event)) > 0);
but it doesn't explain why it just checks for the modified event
getting "wider" (earlier start, later end) than the original event.
I don't understand that logic, i.e. why doesn't it just check that the
dates changed.
Still, now that we keep the original date-time in the
GcalScheduleValues, use them to preserve the original semantics.
I'm not sure exactly what to test about this... a test to preserve those
semantics? A test that the function, per its name, returns true if
the days are strictly different?
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/550>
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
5172b9438a
commit
9d8c6486eb
@@ -888,28 +888,12 @@ gcal_schedule_section_recurrence_changed (GcalScheduleSection *self)
|
||||
gboolean
|
||||
gcal_schedule_section_day_changed (GcalScheduleSection *self)
|
||||
{
|
||||
GDateTime *start_date, *end_date;
|
||||
gboolean all_day;
|
||||
|
||||
g_return_val_if_fail (GCAL_IS_SCHEDULE_SECTION (self), FALSE);
|
||||
|
||||
GCAL_ENTRY;
|
||||
|
||||
all_day = all_day_selected (self);
|
||||
|
||||
if (all_day)
|
||||
{
|
||||
start_date = gcal_date_time_chooser_get_date_time (self->start_date_time_chooser);
|
||||
end_date = gcal_date_time_chooser_get_date_time (self->end_date_time_chooser);
|
||||
}
|
||||
else
|
||||
{
|
||||
start_date = gcal_date_chooser_row_get_date (self->start_date_row);
|
||||
end_date = gcal_date_chooser_row_get_date (self->end_date_row);
|
||||
}
|
||||
|
||||
GCAL_RETURN (gcal_date_time_compare_date (start_date, self->values->date_start) < 0 ||
|
||||
gcal_date_time_compare_date (end_date, self->values->date_end) > 0);
|
||||
GCAL_RETURN (gcal_date_time_compare_date (self->values->date_start, self->values->orig_date_start) < 0 ||
|
||||
gcal_date_time_compare_date (self->values->date_end, self->values->orig_date_end) > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user