src/TimeLib.php
public static function roundTimestampToWeek($timestamp)
    {        
        $roundedToDay = self::roundTimestampToDay($timestamp);
        $weekDay  = date('w', $roundedToDay); # 1 = Monday
        $daysToSubtract = $weekDay - 1;
        $roundedToWeek = strtotime("-" . $daysToSubtract . " day", $roundedToDay);
        
        return $roundedToWeek;
    }
public static function roundTimestampToWeek($timestamp)
    {        
        $roundedToDay = self::roundTimestampToDay($timestamp);
        $weekDay  = date('w', $roundedToDay); # 1 = Monday
        $daysToSubtract = $weekDay - 1;
        $roundedToWeek = strtotime("-" . $daysToSubtract . " day", $roundedToDay);
        
        return $roundedToWeek;
    }
public static function roundTimestampToWeek ( $ timestamp ) { $ roundedToDay = self :: roundTimestampToDay ( $ timestamp ) ; $ weekDay = date ( 'w' , $ roundedToDay ) ; # 1 = Monday $ daysToSubtract = $ weekDay - 1 ; $ roundedToWeek = strtotime ( "-" . $ daysToSubtract . " day" , $ roundedToDay ) ; return $ roundedToWeek ; }
Rounds a timestamp down to midnight on Monday of time it was taken
@param timestamp - the timestamp to round off.
@return roundedTimestamp - the rounded timestamp
Rounds a timestamp down to midnight on Monday of time it was taken