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

12 July 2017 is a holiday in UK #63

Closed
thefuckinggasvols opened this issue Jul 12, 2017 · 10 comments
Closed

12 July 2017 is a holiday in UK #63

thefuckinggasvols opened this issue Jul 12, 2017 · 10 comments
Labels

Comments

@thefuckinggasvols
Copy link

thefuckinggasvols commented Jul 12, 2017

Why is today holiday in uk?

if datetime.date.today() in holidays.UK():
        print('UK holiday')
@oiffrig
Copy link
Contributor

oiffrig commented Jul 12, 2017

>>> holidays.UK()[datetime.date.today()]
'Battle of the Boyne [Northern Ireland]'

However, it seems to concern only Northern Ireland.

@thefuckinggasvols
Copy link
Author

Thanks for the explanation. Is there a "UK Bank Holiday" equivalent?

@hugovk
Copy link
Contributor

hugovk commented Oct 29, 2017

There's quite a few which are only for Northern Ireland or Scotland. I think all the England and Wales ones are also holidays in NI and Scotland.

https://www.gov.uk/bank-holidays

Perhaps the home nations should be added for the UK as "Provinces/States Available"?

https://github.com/ryanss/python-holidays#available-countries

@dr-prodigy
Copy link
Collaborator

dr-prodigy commented Jan 14, 2018

From the code, it seems like that by design. Not really sure if it's correct or not anyway! What do you think?

@coder6464
Copy link

Use holidays.England() for UK Bank Holidays. I've checked this against https://www.gov.uk/bank-holidays

@hugovk
Copy link
Contributor

hugovk commented Jan 21, 2018

This is a bug.

This particular holiday should only be in holidays.NorthernIreland().

@hugovk
Copy link
Contributor

hugovk commented Jan 21, 2018

Or rather, this is by design.

>>> import holidays
>>> for date, name in sorted(holidays.UK(years=2018).items()):
...     print(date, name)
...
2018-01-01 New Year's Day
2018-01-02 New Year Holiday [Scotland]
2018-03-30 Good Friday
2018-04-02 Easter Monday [England, Wales, Northern Ireland]
2018-05-07 May Day
2018-05-28 Spring Bank Holiday
2018-08-06 Summer Bank Holiday [Scotland]
2018-08-27 Late Summer Bank Holiday [England, Wales, Northern Ireland]
2018-11-30 St. Andrew's Day [Scotland]
2018-12-25 Christmas Day
2018-12-26 Boxing Day
>>>

See https://github.com/dr-prodigy/python-holidays/issues/40 for details.

If the holiday has square brackets, you'll need to check the country you're interested in is mentioned.

Or you can check holidays.England() or whichever ones you're interested in.

@dr-prodigy
Copy link
Collaborator

@hugovk : how should we manage this?

@hugovk
Copy link
Contributor

hugovk commented Mar 14, 2018

Well, at the moment it is working as designed, as detailed in #40.

If that's fine for everyone then this can be closed.

@dr-prodigy
Copy link
Collaborator

Okay, that's what I wanted to hear.. ;)
Thx mate!

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

No branches or pull requests

5 participants