コード例 #1
0
  @Test
  public void startAtMidnight() {
    Moment moment = PlainTimestamp.of(2015, 7, 17, 18, 1).atUTC();
    HijriCalendar hijri = HijriCalendar.ofUmalqura(1436, 10, 1);

    assertThat(hijri.atTime(18, 1).at(ZonalOffset.UTC, StartOfDay.MIDNIGHT), is(moment));
    assertThat(
        moment.toGeneralTimestamp(
            HijriCalendar.family(),
            HijriCalendar.VARIANT_UMALQURA,
            ZonalOffset.UTC,
            StartOfDay.MIDNIGHT),
        is(hijri.atTime(18, 1)));
  }
コード例 #2
0
  @Test
  public void startInEvening() {
    Moment moment = PlainTimestamp.of(2015, 7, 17, 18, 1).atUTC();
    HijriCalendar hijri = HijriCalendar.ofUmalqura(1436, 10, 2);

    assertThat(hijri.atTime(18, 1).at(ZonalOffset.UTC, StartOfDay.EVENING), is(moment));
    GeneralTimestamp<HijriCalendar> tsp =
        moment.toGeneralTimestamp(
            HijriCalendar.family(),
            HijriCalendar.VARIANT_UMALQURA,
            ZonalOffset.UTC,
            StartOfDay.EVENING);
    assertThat(tsp.toDate(), is(hijri));
    assertThat(tsp.toTime(), is(PlainTime.of(18, 1)));
  }