$year = date('Y');
$startDate = date('Y-m-d', strtotime("$year-$month-01"));
- $endDate = date('Y-m-t', strtotime($startDate));
+ $endDate = date('Y-m-d');
$dates = [];
$currentDate = strtotime($startDate);
$year = $request->get('year', date('Y'));
$startDate = date('Y-m-d', strtotime("$year-$month-01"));
- $endDate = date('Y-m-t', strtotime($startDate)); // Последний день месяца
+ if ($month == date('m') && $year == date('Y')) {
+ $endDate = date('Y-m-d');
+ } else {
+ $endDate = date('Y-m-t', strtotime($startDate));
+ }
$dates = [];
$currentDate = strtotime($startDate);