florianv / business

:date: DateTime calculations in business hours
http://florianv.github.io/business
MIT License
361 stars 25 forks source link

Case saturday or sunday as working day #28

Open aidar87 opened 6 years ago

aidar87 commented 6 years ago

Hi guys, could you advise how can I set Saturday or Sunday as working day only in some cases( not always)? The special day evaluator requires return an array of opening intervals.

This doesn't work: new SpecialDay(Days::SATURDAY, function (\DateTime $date) { if ('2015-05-29' === $date->format('Y-m-d')) { return [['00:00', '23:59:59']]; } return ; });