Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adc75383 authored by taiki tsutsumi's avatar taiki tsutsumi Committed by Mattias Nilsson
Browse files

Cannot open date before 1970/01/01 from quickcontact screen

The pre-install calendar support to jump the oldest date is 1970/01/01.
If date set before 1970/01/01, it can't jump to the date.

When we save a birthday or anniversary event for a contact, we
set the year to 0, this means when a user for example clicks a birthday
we will open the day of the coming birthday.

Bug: TBD
Test: Manual
Change-Id: I68d207cddbab53b97c1368048a50cda5d6bd5aa2
parent bc0c9bf8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1484,6 +1484,11 @@ public class QuickContactActivity extends ContactsActivity {
            final String dataString = event.buildDataStringForDisplay(context, kind);
            final Calendar cal = DateUtils.parseDate(dataString, false);
            if (cal != null) {
                final int eventType = event.getContentValues().getAsInteger(Event.TYPE);
                if (eventType == Event.TYPE_ANNIVERSARY || eventType == Event.TYPE_BIRTHDAY) {
                    // setting the year to 0 makes a click open the coming birthday
                    cal.set(Calendar.YEAR, 0);
                }
                final Date nextAnniversary =
                        DateUtils.getNextAnnualDate(cal);
                final Uri.Builder builder = CalendarContract.CONTENT_URI.buildUpon();