daysToWeekStart() public static method

Returns number of days to start of this week.
Author: =stid= (s.furiosi@wpxtre.me)
public static daysToWeekStart ( object $date, string $first_day = 'monday' ) : integer
$date object Date object
$first_day string
return integer $date
Beispiel #1
0
 /**
  * Returns number of days to start of this week.
  *
  * @author     =stid= <*****@*****.**>
  *
  * @param string $date
  * @param string $first_day Optional. Start from `monday`
  *
  * @return     int
  */
 public static function beginningOfWeek($date, $first_day = 'monday')
 {
     $days_to_start = WPDKDateTime::daysToWeekStart($date, $first_day);
     return $date - $days_to_start;
 }