AddHoliday - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Finance

 AddHoliday
 add a holiday in a calendar

 Calling Sequence AddHoliday(calendar, date)

Parameters

 date - a string containing a date specification in a format recognized by ParseDate or a Date data structure calendar - a name representing a supported calendar (e.g. Toronto, NewYork) or a calendar data structure created using the Calendar constructor

Description

 • The AddHoliday command updates a given calendar by adding a given date as a holiday.
 • The parameter date must be a date specified in any of the formats recognized by the ParseDate command.
 • The parameter calendar must be either a name representing a supported calendar or a calendar data structure created using the Calendar constructor.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$

Create a sample calendar and modify it.

 > $C≔\mathrm{Calendar}\left(\mathrm{Simple}\right)$
 ${C}{≔}{\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{Holidays}≔\left["January 22, 2004","January 23, 2004","January 24, 2004","January 25, 2004","January 26, 2004","January 27, 2004","January 28, 2004"\right]$
 ${\mathrm{Holidays}}{≔}\left[{"January 22, 2004"}{,}{"January 23, 2004"}{,}{"January 24, 2004"}{,}{"January 25, 2004"}{,}{"January 26, 2004"}{,}{"January 27, 2004"}{,}{"January 28, 2004"}\right]$ (2)
 > $\mathrm{AddHoliday}\left(C,\mathrm{Holidays}\right)$
 > $\mathrm{IsHoliday}\left("January 23, 2004",C\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{AdjustDate}\left("January 23, 2004",C,\mathrm{convention}=\mathrm{Following},\mathrm{output}=\mathrm{formatted}\right)$
 ${"January 29, 2004"}$ (4)
 > $\mathrm{AdjustDate}\left("January 23, 2004",C,\mathrm{convention}=\mathrm{Preceding},\mathrm{output}=\mathrm{formatted}\right)$
 ${"January 21, 2004"}$ (5)

Compatibility

 • The Finance[AddHoliday] command was introduced in Maple 15.
 • For more information on Maple 15 changes, see Updates in Maple 15.