Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Singapore Deepavali for 2021 #432

Closed
jack-pace opened this issue Dec 3, 2019 · 4 comments
Closed

Missing Singapore Deepavali for 2021 #432

jack-pace opened this issue Dec 3, 2019 · 4 comments

Comments

@jack-pace
Copy link
Contributor

This website suggests that it is Thursday 4th November 2021.
https://publicholidays.sg/deepavali/

Without this hardcoded date I am unable to use workalendar to find out any holidays in Singapore for 2021!

I am using python 3.6 and workalendar 7.1.1.

Example

import datetime
import workalendar
calendar = workalendar.registry.registry.get_calendar_class("SG")()
calendar.is_holiday(datetime.date(2021, 1, 1))
.../site-packages/workalendar/core.py:720: UserWarning: Please take note that, due to arbitrary decisions, this Islamic calendar computation may be wrong.
  warnings.warn('Please take note that, due to arbitrary decisions, '
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
...   ...   ...   ...   ...   ...   ...   ...   ...   ...   ...
KeyError: 'Missing date for Singapore Deepavali for year: 2021'
@jack-pace
Copy link
Contributor Author

jack-pace commented Dec 3, 2019

Ideally we'd be able to suppress this error with a flag if we didn't mind about missing Deepavali or other holidays implemented in this way.
For example:

import datetime
import workalendar
calendar = workalendar.registry.registry.get_calendar_class("SG")()
calendar.is_holiday(
    datetime.date(2021, 1, 1),
    best_effort=True,  # Doesn't raise if Deepavali or any other holiday isn't known
)

Does anyone know what would be involved to achieve this? Or have any other opinions / suggestions?

@brunobord
Copy link
Member

closed by merging #433 ; release is on its way.

brunobord added a commit that referenced this issue Dec 6, 2019
**New calendars**

- Added Serbia calendar, by @apelloni (#435).
- Added Argentina calendar, by @ftatarli (#419).

**Other changes**

- Update China's public holidays for 2020, thx @nut-free (#429).
- Update Malaysia and Singapore for 2021 (Deepavali + Thaipusam) by @jack-pace (#432).
- Small refactorings on the Gevena (Switzerland) holiday class, thx to @cw-intellineers (#420).
@brunobord brunobord mentioned this issue Dec 6, 2019
14 tasks
@brunobord
Copy link
Member

version 7.2.0 was just released, the packages were uploaded on PyPI, which includes your contribution. Happy upgrading!

@jack-pace
Copy link
Contributor Author

jack-pace commented Dec 6, 2019

@brunobord Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants