コード例 #1
0
 /**
  * Does another range start before this one does?
  *
  * @param DateRange $other_range
  * @return bool True if the other range starts before this one.
  */
 function startsBefore($other_range)
 {
     $this_start = $this->getStartDate();
     $other_start = $other_range->getStartDate();
     return $this_start->before($other_start);
 }
コード例 #2
0
ファイル: DateRange.php プロジェクト: salamek/php-daterange
 /**
  * @param DateRange $dateRange
  * @return string
  */
 public static function toString(DateRange $dateRange)
 {
     return sprintf('[%s,%s]', $dateRange->getStartDate()->format('Y-m-d'), $dateRange->getEndDate()->format('Y-m-d'));
 }