kylekatarnls / business-time

Carbon mixin to handle business days and opening hours
MIT License
297 stars 14 forks source link

Find out if it's a public holiday but still open #67

Closed informatJonas closed 8 months ago

informatJonas commented 8 months ago

How can I find out if a weekday is a public holiday but is still open?

Can I use carbon.holidaysAreClosed to influence these options?

kylekatarnls commented 8 months ago

Hello, are your referring to the notion of observance that exist in some countries? In the semantic of this library, it's not considered a holiday. This would need to emebed list of them for all countries and add another set of methods for that.

holidaysAreClosed is an option to say: "Is this business closed on observed holidays"

informatJonas commented 8 months ago

What does this "observed holidays" actually mean?

informatJonas commented 8 months ago

I have now solved it like this: !$dateObject->getOpeningHours()->forDate($dateObject)->isEmpty().

kylekatarnls commented 8 months ago

What does this "observed holidays" actually mean?

An actual holiday (that is observed by the country so a typical business is closed on this day)

By opposition to an "observance" which is a term for what you mentioned in your original message as:

a weekday is a public holiday but is still open

Those terms are common in USA but definitions of "holiday" varies from one country to another and business context on the top.

So I cannot provide further assistance without more details.