florianv / business

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

Business hours respecting seconds #19

Closed ceeram closed 8 years ago

ceeram commented 8 years ago

Start and end times can have seconds other then zero.

Currently seconds were ignored, having two problems:

This PR solves both problems. Changes are backwards compatible, except for toInteger() and toString() methods on the Time class

One additional improvement included in this PR, is not to force leading zeros on Time class and allow for integers being passed in.

florianv commented 8 years ago

Hey, thanks for you PR @ceeram.

Changes are backwards compatible, except for toInteger() and toString() methods on the Time class

It should not be an issue as the Time class in meant to be used internally.

ceeram commented 8 years ago

Thanks for the quick merge, making a release, and for the project in general. Keep up the good work. :trophy:

While im at it, you happen to know of a good dynamic holiday calculator? I had looked at having dates for Holiday constructor argument being calculated by pear/Date_Holidays, which can be done, but that code is very outdated, generating lots of warnings and other workarounds needed to make it work.

florianv commented 8 years ago

Thanks for the quick merge, making a release, and for the project in general. Keep up the good work.

Thanks!

While im at it, you happen to know of a good dynamic holiday calculator?

I don't think there is one in PHP. When I created Business, I looked for one but didn't find. I thought about building it but it sounded a huge task to list all holidays per country so I gave up :smile: