APISonar


java.time.chrono.JapaneseChronology.INSTANCE.date

> java > time > chrono > JapaneseChronology > INSTANCE > date
java APIs time APIs chrono APIs JapaneseChronology APIs INSTANCE APIs date APIs

Example 1
public void test_adjust_toLocalDate() {
        JapaneseDate jdate = JapaneseChronology.INSTANCE.date(1926, 1, 4);
        JapaneseDate test = jdate.with(LocalDate.of(2012, 7, 6));
        assertEquals(test, JapaneseChronology.INSTANCE.date(2012, 7, 6));
    }
Example 2
public void test_adjust2() {
        JapaneseDate base = JapaneseChronology.INSTANCE.date(1928, 12, 2);
        JapaneseDate test = base.with(TemporalAdjusters.lastDayOfMonth());
        assertEquals(test, JapaneseChronology.INSTANCE.date(1928, 12, 31));
    }
Example 3
public void test_adjust_toMonth() {
        JapaneseDate jdate = JapaneseChronology.INSTANCE.date(1926, 1, 4);
        jdate.with(Month.APRIL);
    }
Example 4
public void test_createEymd(JapaneseEra era, int yoe, int moy, int dom, int doy, LocalDate iso) {
        JapaneseDate dateByChronoFactory = JapaneseChronology.INSTANCE.date(era, yoe, moy, dom);
        JapaneseDate dateByDateFactory = JapaneseDate.of(era, yoe, moy, dom);
        assertEquals(dateByChronoFactory, dateByDateFactory);
        assertEquals(dateByChronoFactory.hashCode(), dateByDateFactory.hashCode());
    }
Example 5
public void test_LocalDate_adjustToJapaneseDate() {
        JapaneseDate jdate = JapaneseChronology.INSTANCE.date(1928, 10, 29);
        LocalDate test = LocalDate.MIN.with(jdate);
        assertEquals(test, LocalDate.of(1928, 10, 29));
    }
Example 6
public void test_getLong() {
        JapaneseDate base = JapaneseChronology.INSTANCE.date(JapaneseEra.SHOWA, 63, 6, 30);
        assertEquals(base.getLong(ERA), JapaneseEra.SHOWA.getValue());
        assertEquals(base.getLong(YEAR), 1988L);
        assertEquals(base.getLong(YEAR_OF_ERA), 63L);
        assertEquals(base.getLong(MONTH_OF_YEAR), 6L);
        assertEquals(base.getLong(DAY_OF_MONTH), 30L);
    }