WPDKDateTime::beginningOfWeek PHP Method

beginningOfWeek() public static method

Returns number of days to start of this week.
Author: =stid= ([email protected])
public static beginningOfWeek ( string $date, string $first_day = 'monday' ) : integer
$date string
$first_day string Optional. Start from `monday`
return integer
    public static function beginningOfWeek($date, $first_day = 'monday')
    {
        $days_to_start = WPDKDateTime::daysToWeekStart($date, $first_day);
        return $date - $days_to_start;
    }