Exemplo n.º 1
0
 /**
  * Returns the date of the Monday of this week.
  *
  * This is often used as a handle on the week commencing date
  *
  * @param RhubarbDateTime $referenceDate The date to find the previous Monday of. Today if null.
  * @return RhubarbDate
  */
 public static function previousMonday($referenceDate = null)
 {
     if ($referenceDate == null) {
         $referenceDate = new RhubarbDateTime("today");
     }
     $dow = $referenceDate->format("N");
     $dow--;
     $dow = -$dow;
     $referenceDate->modify($dow . " days");
     return $referenceDate;
 }