APISonar


java.time.chrono.MinguoChronology.INSTANCE.date

> java > time > chrono > MinguoChronology > INSTANCE > date
java APIs time APIs chrono APIs MinguoChronology APIs INSTANCE APIs date APIs

Example 1
public void test_adjust1() {
        MinguoDate base = MinguoChronology.INSTANCE.date(2012, 10, 29);
        MinguoDate test = base.with(TemporalAdjusters.lastDayOfMonth());
        assertEquals(test, MinguoChronology.INSTANCE.date(2012, 10, 31));
    }
Example 2
public void test_adjust_toMonth() {
        MinguoDate minguo = MinguoChronology.INSTANCE.date(1726, 1, 4);
        minguo.with(Month.APRIL);
    }
Example 3
public void test_periodUntilDiffChrono(HijrahDate h1, HijrahDate h2, ChronoPeriod p) {
        MinguoDate m = MinguoChronology.INSTANCE.date(h2);
        ChronoPeriod period = h1.until(m);
        assertEquals(period, p);
    }
Example 4
public void test_periodUntilDiffChrono() {
        ThaiBuddhistDate mdate1 = ThaiBuddhistDate.of(1, 1, 1);
        ThaiBuddhistDate mdate2 = ThaiBuddhistDate.of(2, 2, 2);
        MinguoDate ldate2 = MinguoChronology.INSTANCE.date(mdate2);
        ChronoPeriod period = mdate1.until(ldate2);
        assertEquals(period, ThaiBuddhistChronology.INSTANCE.period(1, 1, 1));
    }
Example 5
public void test_fromCalendrical(MinguoDate minguo, LocalDate iso) {
        assertEquals(MinguoChronology.INSTANCE.date(iso), minguo);
        assertEquals(MinguoDate.from(iso), minguo);
    }
Example 6
public void test_periodUntilDiffChrono() {
        JapaneseDate mdate1 = JapaneseDate.of(1970, 1, 1);
        JapaneseDate mdate2 = JapaneseDate.of(1971, 2, 2);
        MinguoDate ldate2 = MinguoChronology.INSTANCE.date(mdate2);
        ChronoPeriod period = mdate1.until(ldate2);
        assertEquals(period, JapaneseChronology.INSTANCE.period(1, 1, 1));
    }
Example 7
public void test_MinguoChrono() {
        MinguoDate h1 = MinguoChronology.INSTANCE.date(MinguoEra.ROC, 1, 2, 3);
        MinguoDate h2 = h1;
        ChronoLocalDateTime<MinguoDate> h3 = h2.atTime(LocalTime.NOON);
        @SuppressWarnings("unused")
        ChronoZonedDateTime<MinguoDate> h4 = h3.atZone(ZoneOffset.UTC);
    }
Example 8
public void test_LocalDateTime_adjustToMinguoDate() {
        MinguoDate minguo = MinguoChronology.INSTANCE.date(101, 10, 29);
        LocalDateTime test = LocalDateTime.MIN.with(minguo);
        assertEquals(test, LocalDateTime.of(2012, 10, 29, 0, 0));
    }
Example 9
public void test_Instant_zonedDateTime() {
        OffsetDateTime offsetDateTime = OffsetDateTime.of(2012, 2, 29, 2, 7, 1, 1, OFFSET_PTWO);
        ZonedDateTime zonedDateTime = ZonedDateTime.of(2012, 2, 29, 2, 7, 1, 1, ZONE_PARIS);

        ChronoZonedDateTime<MinguoDate> result = MinguoChronology.INSTANCE.zonedDateTime(offsetDateTime.toInstant(), offsetDateTime.getOffset());
        assertEquals(result.toLocalDate(), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29));
        assertEquals(result.toLocalTime(), LocalTime.of(2, 7, 1, 1));

        result = MinguoChronology.INSTANCE.zonedDateTime(zonedDateTime.toInstant(), zonedDateTime.getOffset());
        assertEquals(result.toLocalDate(), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29));
        assertEquals(result.toLocalTime(), LocalTime.of(2, 7, 1, 1));
    }