I want to get the start date and end date of a week . I am using
$monday = date('Y-m-d', strtotime('this monday', strtotime($model->date)));
$saturday = date('Y-m-d', strtotime('this saturday', strtotime($model->date)));
when date is 18-09-2017 then monday is 18-09-2017 and saturaday is 23-09-2017. However, when date is 23-09-2017 then monday is 25-09-2017 and saturday is 23-09-2017.
Why is it so?
How can I adjust the code to give always moday as 18-09-2017 and saturday 23-09-2017 when the date is 18-09-2017 or 23-09-2017. I want uniformity.