You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it stands, the map defining each holiday doesn't have any constraints on what fields it contains.
I think this will be done with structs, but I haven't worked with them much yet.
There are 3 different kinds of holiday definitions. Does that mean 3 different Struct types?
static holidays fall on a given day and month every year. eg. New Year's Day is always January 1st.
nth holidays fall on the nth weekday of a given month. eg. Memorial Day in the US is on the last Monday in May.
function holidays use a function to determine their date. The function typically has year as its parameter. The definition of a function is given as a tuple {ModuleName, :functionName, [params]}. Easter Sunday is the best example. There can also be a 4th element of the tuple, which is an integer representing how many days to add (or subtract via negative number) to the date returned by the function. For Good Friday we use the :easter function and subtract 2 days.
The text was updated successfully, but these errors were encountered:
CoderDennis
changed the title
Provide some kind of spec or template for the holiday definition map
Use a Struct or Structs for the holiday definition map
Jan 9, 2022
As it stands, the map defining each holiday doesn't have any constraints on what fields it contains.
I think this will be done with structs, but I haven't worked with them much yet.
There are 3 different kinds of holiday definitions. Does that mean 3 different Struct types?
year
as its parameter. The definition of a function is given as a tuple{ModuleName, :functionName, [params]}
. Easter Sunday is the best example. There can also be a 4th element of the tuple, which is an integer representing how many days to add (or subtract via negative number) to the date returned by the function. For Good Friday we use the:easter
function and subtract 2 days.The text was updated successfully, but these errors were encountered: