mP1 / j2cl-java-util-timezone-ZoneRulesReader

Provides a source of zone rules for j2cl-java-util-TimeZone to read timezone data.
Apache License 2.0
0 stars 0 forks source link

Investigate why zoneIds=Africa/Casablanca and Africa/El_Aaiun TimeZone.observesDaylightSaving disagrees with org.threeten.bp.zone.ZoneRules.observesDaylightSaving. #20

Open mP1 opened 5 months ago

mP1 commented 5 months ago

Not sure why all other JRE timezone zoneids agree but these two fail.

Have verified in a debugger that the ZoneRules internal property holding the rules is empty and the TimeZone corresponding property has several rules.


    @Test
    public void testObservesDaylightTimeAllTimezones() throws Exception {
        for (final String zoneId : TimeZone.getAvailableIDs()) {
            switch (zoneId) {
                case "Africa/Casablanca":
                case "Africa/El_Aaiun":
                    break;
                default:
                    if (isSupportedTimeZoneId(zoneId)) {
                        this.observesDaylightTimeAndCheck(zoneId);
                    }
            }
        }
    }

    private void observesDaylightTimeAndCheck(final String zoneId) throws Exception {
        this.checkEquals(
                java.util.TimeZone.getTimeZone(zoneId).observesDaylightTime(),
                walkingkooka.j2cl.java.util.timezone.zonerulesreader.org.threeten.bp.zone.ZoneRules.of(ZoneId.of(zoneId)).observesDaylightTime(),
                () -> "observesDaylightTime for zoneId " + CharSequences.quoteAndEscape(zoneId)
        );
    }