-
Is there any documentation page that explains the _add_holiday method where you add a specific day in each. I was looking through the code and the logic seems to be based on a regex of the name and ends up calling _get_nth_weekday_from eventually but there are no examples in the document that explain how to call these functions for creating a new customized exchange holiday calendar. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @maxrausch,
I'll create an issue for documenting this. |
Beta Was this translation helpful? Give feedback.
Hi @maxrausch,
you're absolutely right -- there is no documentation for these methods. You can blame me for that. I implemented those methods as a part of syntactic sugar improvements for PH needs. You can still use the "old fashioned" way for adding holidays directly, e.g.
entity[dt] = "My Holiday"
. Here you can find the implementation with my comments. Essentially the code supports 4 different cases (from most to least frequently used):<month> <day>
patterns (e.g., _add_holiday_jun_15()).<last/nth> <weekday> of <month>
patterns (e.g., _add_holiday_last_mon_of_aug() or _add_holiday_3rd_fri_of_aug()).<n> day(s) <past/prior> <last/<nth> <weekday> of <month>
patterns (e.g., _add_holiday…