Finance - Maple Programming Help

Home : Support : Online Help : Mathematics : Finance : Date Arithmetic : Finance/JoinHolidays

Finance

 JoinHolidays
 construct new calendar by joining holidays from the given two calendars

 Calling Sequence JoinHolidays(calendar1, calendar2)

Parameters

 calendar1 - a name representing a supported calendar (e.g. Toronto, NewYork) or a calendar data structure created using the Calendar constructor calendar2 - a name representing a supported calendar (e.g. Toronto, NewYork) or a calendar data structure created using the Calendar constructor

Description

 • The JoinHolidays command creates a new calendar obtained by joining holidays from the given two calendars. Any dates that are holidays in either of the given two calendars become holidays in the new calendar.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $\mathrm{Calendar1}≔\mathrm{Calendar}\left(\mathrm{Toronto}\right):$
 > $\mathrm{Calendar2}≔\mathrm{Calendar}\left(\mathrm{Null}\right)$
 ${\mathrm{Calendar2}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (1)
 > $\mathrm{AddHoliday}\left(\mathrm{Calendar2},"January 4, 2006"\right):$
 > $\mathrm{IsHoliday}\left("January 3, 2006",\mathrm{Calendar1}\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{IsBusinessDay}\left("January 3, 2006",\mathrm{Calendar1}\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{IsHoliday}\left("January 1, 2006",\mathrm{Calendar1}\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{IsBusinessDay}\left("January 1, 2006",\mathrm{Calendar1}\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{Calendar3}≔\mathrm{JoinHolidays}\left(\mathrm{Calendar1},\mathrm{Calendar2}\right):$
 > $\mathrm{IsHoliday}\left("January 1, 2006",\mathrm{Calendar3}\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{IsHoliday}\left("January 4, 2006",\mathrm{Calendar3}\right)$
 ${\mathrm{true}}$ (7)
 > $\mathrm{RemoveHoliday}\left("January 1, 2006",\mathrm{Calendar3}\right):$
 > $\mathrm{IsHoliday}\left("January 1, 2006",\mathrm{Calendar3}\right)$
 ${\mathrm{false}}$ (8)

Compatibility

 • The Finance[JoinHolidays] command was introduced in Maple 15.