/**
  * Obtains a local date in Thai Buddhist calendar system from the
  * proleptic-year and day-of-year fields.
  *
  * @param int $prolepticYear the proleptic-year
  * @param int $dayOfYear the day-of-year
  * @return ThaiBuddhistDate the Thai Buddhist local date, not null
  * @throws DateTimeException if unable to create the date
  */
 public function dateYearDay($prolepticYear, $dayOfYear)
 {
     return ThaiBuddhistDate::ofIsoDate(LocalDate::ofYearDay($prolepticYear - self::YEARS_DIFFERENCE, $dayOfYear));
 }
Example #2
0
 /**
  * Obtains an ISO local date from the proleptic-year and day-of-year fields.
  * <p>
  * This is equivalent to {@link LocalDate#ofYearDay(int, int)}.
  *
  * @param int $prolepticYear the ISO proleptic-year
  * @param int $dayOfYear the ISO day-of-year
  * @return LocalDate the ISO local date, not null
  * @throws DateTimeException if unable to create the date
  */
 public function dateYearDay($prolepticYear, $dayOfYear)
 {
     return LocalDate::ofYearDay($prolepticYear, $dayOfYear);
 }
 /**
  * @expectedException \Celest\DateTimeException
  */
 public function test_factory_ofYearDay_ints_yearTooLow()
 {
     LocalDate::ofYearDay(Integer::MIN_VALUE, 1);
 }
Example #4
0
 /**
  * Combines this year with a day-of-year to create a {@code LocalDate}.
  * <p>
  * This returns a {@code LocalDate} formed from this year and the specified day-of-year.
  * <p>
  * The day-of-year value 366 is only valid in a leap year.
  *
  * @param int $dayOfYear the day-of-year to use, from 1 to 365-366
  * @return LocalDate the local date formed from this year and the specified date of year, not null
  * @throws DateTimeException if the day of year is zero or less, 366 or greater or equal
  *  to 366 and this is not a leap year
  */
 public function atDay($dayOfYear)
 {
     return LocalDate::ofYearDay($this->year, $dayOfYear);
 }
 /**
  * Obtains a local date in Minguo calendar system from the
  * proleptic-year and day-of-year fields.
  *
  * @param int $prolepticYear the proleptic-year
  * @param int $dayOfYear the day-of-year
  * @return MinguoDate the Minguo local date, not null
  * @throws DateTimeException if unable to create the date
  */
 public function dateYearDay($prolepticYear, $dayOfYear)
 {
     return MinguoDate::ofIsoDate(LocalDate::ofYearDay($prolepticYear + self::YEARS_DIFFERENCE, $dayOfYear));
 }