Get date by holiday string
See original GitHub issueHello! I feel like this is a dumb question but am just not seeing anything about it in the readme.
Is there a method that supports something like us_holidays.get('Thanksgiving')
?
For example if I wanted to add the day after Thanksgiving to my custom calendar, I will need to first get that holiday, which feels like an odd thing to do manually with a library that handles holidays -
class MyCal(holidays.UnitedStates):
def _populate(self, year):
holidays.UnitedStates._populate(self, year)
# Add Friday after Thanksgiving
thanksgiving = date(year, 11, 1) + rd(weekday=TH(+4))
thanksgiving_friday = thanksgiving + rd(days=1)
self[thanksgiving_friday] = 'Thanksgiving Friday'
(this is just an example, I know I can get the day other ways)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to get the holidays date in my case? - Stack Overflow
I made your original list of holiday dates into an array called holidays . The holiday variable on the line with the forEach...
Read more >date-holidays-parser/Holidays.md at master - GitHub
get all holidays for year with names using preferred language. Parameters. year: String | Date , if omitted, the current year is chosen....
Read more >5 Minute Guide to Detecting Holidays in Python
It allows you to get dates and names of major holidays for specific year(s) and for a specific country. You might be wondering...
Read more >Referencing Holiday String in a formula - Airtable Community
Solved: Hi! I'm working on setting up a long-running {Task Due} date formula field that will eventually span across multiple years.
Read more >String to Date? - Piston: Design Help
just to state the obvious, :smiley: with known holiday dates from that URL, you could find each dates 'F E M' format and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@samtregar Glad to be helping! Sorry for getting there a little late, but better late than never… 😃
Hi, thank you for your interest in holidays library. I’ve added get_named(key) method, receiving a complete or partial string, which will be checked against all currently available holidays (ie: depending on initialization), applying a case insensitive match. Results are returned in a list containing all matched dates.
Pushed on beta branch, thank you again, cheers! dr-p