I'm working on a plugin, but I can't get it working.
The code below is supposed to do something when the current date is between 2 chosen dates by the user.
So if date is in between 12-01-2016 ($snow['period_past']
) and tomorrow is 12-03-2016 ($snow['period_future']
), do something...
$date = date('Y-m-d');
$date = date('Y-m-d', strtotime($date));
$snowStart = date('Y-m-d', strtotime($snow['period_past']));
$snowEnd = date('Y-m-d', strtotime($snow['period_future']));
if (($date > $snowStart) && ($date < $snowEnd)) {
// do this and that
}
The code above works, but it only works between the dates. How can I make it work so it also works when its at the $snow['period_past']
date and $snow['period_future']
date?
Sorry for my bad explanation, English is not my native language.