Issue with off days / $disable_dates[] arr
-
Hi team
Just to let you know of an issue which I resolved and you may want to apply it to master.
As your month name -> number conversion conversion which took “april” name and tried to convert to the month number. PHPs strtotime() tries to convert a date string (i.e. day-month-year) but it will fill in the blanks when they’re missing based on today’s date which works most of the time. In this case the strtotime(“april”) was trying to “fill in” 31st April 2020 which doesn’t exist, so it automatically rolls on to the next month as the system thinks the date has passed.
This meant that on the 31st March, it wasn’t blocking any dates for the 1st, 2nd, 3rd April as it was resolving May instead (as 31st Apr doesn’t exist).
It’s a simple fix to append the day month and year to the strtotime() input too;
$disable_dates[] = $year . “-” . date(‘m’,strtotime(“$day $month $year”)) . “-” .$day;
Hope that helps!
The topic ‘Issue with off days / $disable_dates[] arr’ is closed to new replies.