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

Commit b074d064 authored by Victor Chang's avatar Victor Chang Committed by android-build-merger
Browse files

Merge "Fix incorrect GMT offset in display" into pi-dev

am: caf72cf3

Change-Id: Id8ccf9caa54e655f810d77baf19c7d6df55a9087
parents 072a60c8 caf72cf3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ public class TimeZoneInfo {
        public TimeZoneInfo format(TimeZone timeZone) {
            final String id = timeZone.getID();
            final TimeZoneNames timeZoneNames = mTimeZoneFormat.getTimeZoneNames();
            final java.util.TimeZone javaTimeZone = android.icu.impl.TimeZoneAdapter.wrap(timeZone);
            final java.util.TimeZone javaTimeZone = java.util.TimeZone.getTimeZone(id);
            final CharSequence gmtOffset = ZoneGetter.getGmtOffsetText(mTimeZoneFormat, mLocale,
                javaTimeZone, mNow);
            return new TimeZoneInfo.Builder(timeZone)
+9 −0
Original line number Diff line number Diff line
@@ -43,4 +43,13 @@ public class TimeZoneInfoTest {
        assertThat(timeZoneInfo.getStandardName()).isEqualTo("Pacific Standard Time");
        assertThat(timeZoneInfo.getDaylightName()).isEqualTo("Pacific Daylight Time");
    }

    @Test
    public void getGmtOffset_zoneLordHowe_correctGmtOffset() {
        Date date = new Date(1514764800000L); // 00:00 1/1/2018 GMT
        Formatter formatter = new Formatter(Locale.US, date);

        TimeZoneInfo timeZoneInfo = formatter.format("Australia/Lord_Howe");
        assertThat(timeZoneInfo.getGmtOffset().toString()).isEqualTo("GMT+11:00");
    }
}