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

Commit 52ec9cc5 authored by Lennart K's avatar Lennart K Committed by Gitsaibot
Browse files

Time switchTimezone: Also update timezone attribute

Fixes #2019
parent 424b8d67
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -212,6 +212,7 @@ public class Time {
    }

    public void switchTimezone(String timezone) {
        this.timezone = timezone;
        long msBefore = mCalendar.getTimeInMillis();
        mCalendar.setTimeZone(TimeZone.getTimeZone(timezone));
        mCalendar.setTimeInMillis(msBefore);
+4 −0
Original line number Diff line number Diff line
@@ -340,6 +340,10 @@ public class RecurrencePickerDialog extends DialogFragment implements OnItemSele
                    model.endDate.switchTimezone(Time.TIMEZONE_UTC);
                    model.endDate.normalize();
                    er.until = model.endDate.format2445();
                    if (!er.until.endsWith("Z")) {
                        // Safeguard to not create invalid data
                        throw new IllegalStateException("UNTIL parameter not in UTC");
                    }
                    er.count = 0;
                } else {
                    throw new IllegalStateException("end = END_BY_DATE but endDate is null");