florianv / business

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

Provide an example (or implementation) of 24/7 working time. #22

Open ddinchev opened 7 years ago

ddinchev commented 7 years ago

I wasn't able to figure out from examples how to nicely model 24/7 working time. It seems to be a common general case so if it's already implemented elegantly, it would be nice to have an example in the docs. Otherwise, this issue could be a starting point for discussion for potential implementation.

florianv commented 7 years ago

Hey @ddinchev,

I didn't test it but would something like this work ?

$days = [
    new Day(Days::MONDAY, [['00:00', '23:59']]),
    new Day(Days::TUESDAY, [['00:00', '23:59']]),
    // etc
];