This involves:
1: Adding a new Market enum variant in calendar.rs
Add either:
- A new country (e.g. Australia).
- Or an MIC code (e.g. XASX) if for a specific exchange.
pub enum Market {
/// Null calendar.
None,
/// Weekend-only calendar.
Weekends,
/// Argentina national calendar.
Argentina,
/// Australia national calendar.
Australia,
...
}
2: Implement the appropriate is_holiday_impl_* function
Add a new is_holiday_impl_* function in the appropriate file under countries/.
pub(crate) fn is_holiday_impl_australia(date: Date) -> bool {
let (y, m, d, wd, yd, em) = unpack_date(date, false);
if
// New Year's Day (possibly moved to Monday)
((d == 1 || ((d == 2 || d == 3) && wd == Weekday::Monday)) && m == Month::January)
// Australia Day, January 26th (possibly moved to Monday)
|| ((d == 26 || ((d == 27 || d == 28) && wd == Weekday::Monday)) && m == Month::January)
...
// National Day of Mourning for Her Majesty, September 22 (only 2022)
|| (d == 22 && m == Month::September && y == 2022)
{
return true;
}
false
}
To-do:
This involves:
1: Adding a new
Marketenum variant incalendar.rsAdd either:
2: Implement the appropriate
is_holiday_impl_*functionAdd a new
is_holiday_impl_*function in the appropriate file undercountries/.To-do: