tidyverts / tsibble

Tidy Temporal Data Frames and Tools
https://tsibble.tidyverts.org
GNU General Public License v3.0
528 stars 50 forks source link

holiday_aus Boxing Day weekend shift #251

Closed ghost closed 2 years ago

ghost commented 3 years ago

The holiday_aus function shifts Boxing Day (the public holiday after Christmas Day) when it falls on a Sunday to the following Monday, however when Boxing Day falls on a Sunday, Christmas Day will fall on the Saturday, and the following Monday will be the Christmas Day public holiday, and the following Tuesday will be the Boxing Day Public Holiday.

Hence in holiday.r the statement below: boxing <- as_date(ifelse( boxing_wday == 1, # Sunday boxing + days(1), # shift to next Monday boxing ))

Should be: boxing <- as_date(ifelse( boxing_wday == 1, # Sunday boxing + days(2), # shift to next Tuesday boxing ))

As it happens 2021 is such a year, see: https://info.australia.gov.au/about-australia/special-dates-and-events/public-holidays

The existing function has both Christmas Day and Boxing Day falling on the 27th, per the link above the Boxing Day falls on the 28th:

holiday_aus(2021, "national")
earowang commented 2 years ago

thank you for filing the bug, and fixed now.