public static function getWeekRangeForDate($date = null)
{
- $date = $date ?? date('Y-m-d');
+ $date = $date ?? strtotime(date('Y-m-d'));
$day = date('d', $date);
$month = date('m', $date);
- $year = date('m', $date);
+ $year = date('Y', $date);
$weekNumber = intdiv($day - 1, 7) + 1;
public static function getWeek($date = null)
{
- $date = $date ?? date('d');
+ $date = $date ?? date("d");
$d = date("d", strtotime($date));
return intval(floor(($d - 1) / 7) + 1);