[evolution-data-server] I#88 - Contacts with Birthday on Feb 29th Have No Appointment in Non-leap Years
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] I#88 - Contacts with Birthday on Feb 29th Have No Appointment in Non-leap Years
- Date: Fri, 22 Feb 2019 07:54:11 +0000 (UTC)
commit 293ec68ffbec4cb73c3e5e07b64fd55a12caa132
Author: Milan Crha <mcrha redhat com>
Date: Fri Feb 22 08:52:08 2019 +0100
I#88 - Contacts with Birthday on Feb 29th Have No Appointment in Non-leap Years
Closes https://gitlab.gnome.org/GNOME/evolution-data-server/issues/88
src/calendar/backends/contacts/e-cal-backend-contacts.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/src/calendar/backends/contacts/e-cal-backend-contacts.c
b/src/calendar/backends/contacts/e-cal-backend-contacts.c
index c91079fba..de1716941 100644
--- a/src/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/src/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -901,6 +901,7 @@ create_component (ECalBackendContacts *cbc,
struct icalrecurrencetype r;
gchar *since_year;
GSList recur_list;
+ gboolean is_leap_day;
g_return_val_if_fail (E_IS_CAL_BACKEND_CONTACTS (cbc), NULL);
@@ -929,6 +930,9 @@ create_component (ECalBackendContacts *cbc,
dt.tzid = NULL;
e_cal_component_set_dtstart (cal_comp, &dt);
+ itt = icaltime_normalize (itt);
+ is_leap_day = itt.day == 29 && itt.month == 2;
+
itt = cdate_to_icaltime (cdate);
icaltime_adjust (&itt, 1, 0, 0, 0);
dt.value = &itt;
@@ -940,6 +944,8 @@ create_component (ECalBackendContacts *cbc,
icalrecurrencetype_clear (&r);
r.freq = ICAL_YEARLY_RECURRENCE;
r.interval = 1;
+ if (is_leap_day)
+ r.by_month_day[0] = -1;
recur_list.data = &r;
recur_list.next = NULL;
e_cal_component_set_rrule_list (cal_comp, &recur_list);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]