In the canWork() function, instead of working with the last time user worked, you'd compare today's date to the date you wanted.
PHP Code:
//get today's date, format returns the date in the specified format. m means month and d is day. So 'm-d' means 'month-day' format
$dateToday = new DateTime;
$dateTime = $dateToday->format('m');//get the month only for example
//compare with the month we want
if($dateTime != '04')
{
//it's not april yet, can't work
}
else{
//it's april, can work
}
//or for month-day
$dateToday = new DateTime;
$dateTime = $dateToday->format('m-d');//get the month only for example
//compare with the month we want
if($dateTime != '04-15')
{
//it's not april 15 yet, can't work
}
else{
//it's april 15, can work
}