public static function cWeekBeginning($year, $cWeek = 0)
{
if ($cWeek <= 1 || $cWeek > static::cWeeks($year)) {
$first = mktime(0, 0, 0, 1, 1, $year);
$wtag = date('w', $first);
if ($wtag <= 4) {
/* Thursday or less: back to Monday */
$firstmonday = mktime(0, 0, 0, 1, 1 - ($wtag - 1), $year);
} elseif ($wtag != 1) {
/* Back to Monday */
$firstmonday = mktime(0, 0, 0, 1, 1 + (7 - $wtag + 1), $year);
} else {
$firstmonday = $first;
}
return $firstmonday;
}
$monday = strtotime($year . 'W' . static::pad($cWeek) . '1');
return $monday;
}