Modest Refactor: Allow use of definitions directly from the holiday repository#54
Open
voughtdq wants to merge 8 commits intotoggl:masterfrom
Open
Modest Refactor: Allow use of definitions directly from the holiday repository#54voughtdq wants to merge 8 commits intotoggl:masterfrom
voughtdq wants to merge 8 commits intotoggl:masterfrom
Conversation
in_year_ranges?/2 was failing because it expects a list for the first argument, but some rules produce a map instead of a list.
For Holidefs.Definition.CustomFunctions: - Add orthodox_easter_julian/2 as an alias - Add Rosh Hashanah dates up to 2052 - Add Yom Kippur dates up to 2052 - Add Matariki dates up to 2052 - Add epiphany/2 - Add to_near_monday_after/2 - Add qld_brisbane_ekka_holiday/2 - Add qld_kings_bday_october/2 - Add ch_be_zibelemaerit/2 - Add saint_josephs_day/2 - Add saint_peter_and_saint_paul/2 - Add assumption_of_mary/2 - Add columbus_day/2 - Add all_saints_day/2 - Add independence_of_cartagena/2 - Add co_shift_date/3 to assist other functions For Holidefs.DateCalculator: - Add to_nearest_monday_after/1
Some rules failed to build because their maps didn't match the clauses in build/3. - Added week!/1 for validating weeks - Added weekday!/1 for validating weekdays as well as converting Ruby's Sunday value (0) to Elixir's Sunday value (7) so that manual edits of the definition files are no longer necessary - Changed function_from_name/1 to function_from_name!/1 and raise a FunctionNotDefinedError when the function isn't available - Added fall-through cases for function_from_name!/1 - Tests check for the new exceptions and verify the Ruby week day gets converted properly
When :deps is supplied in the third argument, we use the holiday definitions from the deps path instead of the priv directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to be able to use the definitions repository directly. This way, it's simply a matter of updating the dep entry in mix.exs. All changes are backwards compatible and these changes are opt-in only. All modifications were made under the provided nix flake environment.