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

Add Toronto Stock Exchange (TSX) definitions #212

Merged
merged 1 commit into from
Aug 11, 2024

Conversation

selesse
Copy link
Contributor

@selesse selesse commented Jan 13, 2022

The Toronto Stock Exchange (TSX) definitions are very close, but not quite to Canada's Ontario holidays. The only difference is that the TSX also observes Civic Holiday.

I have validated that these definitions match the dates provided on the TSX's website:

irb(main):035:0> Holidays.load_custom(File.expand_path('~/git/definitions/tsx.yaml')); nil
=> nil
irb(main):036:0> Holidays.between(Date.civil(2022, 1, 1), Date.civil(2022, 12, 31), :tsx, :observed).each { |h| puts h[:date].to_s + " => " + h[:name] }
2022-01-03 => New Year's Day
2022-02-21 => Family Day
2022-04-15 => Good Friday
2022-05-23 => Victoria Day
2022-07-01 => Canada Day
2022-08-01 => Civic Holiday
2022-09-05 => Labour Day
2022-10-10 => Thanksgiving
2022-12-26 => Christmas Day
2022-12-27 => Boxing Day
irb(main):037:0> Holidays.between(Date.civil(2021, 1, 1), Date.civil(2021, 12, 31), :tsx, :observed).each { |h| puts h[:date].to_s + " => " + h[:name] }
2021-01-01 => New Year's Day
2021-02-15 => Family Day
2021-04-02 => Good Friday
2021-05-24 => Victoria Day
2021-07-01 => Canada Day
2021-08-02 => Civic Holiday
2021-09-06 => Labour Day
2021-10-11 => Thanksgiving
2021-12-27 => Christmas Day
2021-12-28 => Boxing Day

Process

I copy/pasted the relevant holidays from ca.yaml, renamed the region to tsx. I also copied the relevant tests. make validate ran successfully. I also made sure the code coverage was 100%, opened #213 to make sure the contribution guidelines were clearer on this point.

@selesse selesse force-pushed the add-tsx branch 4 times, most recently from aeab512 to 2b3f851 Compare January 14, 2022 00:10
@ppeble ppeble merged commit 673492c into holidays:master Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants