Пример #1
0
 /**
  * Returns a copy of this LocalDateTime with the date altered.
  *
  * @param LocalDate $date
  *
  * @return LocalDateTime
  */
 public function withDate(LocalDate $date)
 {
     if ($date->isEqualTo($this->date)) {
         return $this;
     }
     return new LocalDateTime($date, $this->time);
 }
Пример #2
0
 /**
  * Returns whether this LocalDateRange is equal to the given one.
  *
  * @param LocalDateRange $that The range to compare to.
  *
  * @return boolean True if this range equals the given one, false otherwise.
  */
 public function isEqualTo(LocalDateRange $that)
 {
     return $this->startDate->isEqualTo($that->startDate) && $this->endDate->isEqualTo($that->endDate);
 }