Skip to content

Working days and other classification #99

@c960657

Description

@c960657

Working days

AbstractProvider::isWorkingDay() returns true for any defined holiday, including e.g. Valentines Day. This is surprising. I belive Valentines Day is a working day for everyone, even the most romantically inclined :-)

I guess all TYPE_OFFICIAL holidays are official non-workdays. But there are also some holidays TYPE_OBSERVANCE holidays that are de-facto non-workdays, at least for some companies/public offices.

For a large number of use-cases for showing holidays in business software, the only holidays of interest are those that affect the business, i.e. when other businesses (banks in particular) are closed. And not so much when people buy flowers to their sweethearts :-)

I know that “working day” is not a boolean property. But I think holidays can be tagged with different fairly objective properties that allow users to get a list of holidays that are relevant for a specific purpose.

Other use-cases include listing all bank holidays or holidays where shops are closed.

I suggest adding a new attribute in addition to the current TYPE_xxx property. This should be a bitmask or tag list that allows multiple flags/tags per holiday.

Currently a holiday can only have one type, so if a holiday is both a public holiday and a bank holiday, it can only be classified as one of them. This means that you cannot get a list of all bank holidays.

The list of flags could look something like this:

  • Official non-working holiday.
  • Other official or de facto non-working day, all companies/public offices are closed.
  • Other official or de facto non-working day, a significant number of companies/public offices are closed.
  • Official holiday or officially recognised day, working day.
  • All banks are closed.
  • All shops are closed.
  • All schools are closed.
  • Festive day celebrated by a significant part of the population.

The exact meaning of the words “all” and “significant” should be defined more clearly, e.g. >95% and >30%, respectively.

What do you think of adding such extra data?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions