create new calendar - Maple Help

Online Help

All Products    Maple    MapleSim


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

Finance[Calendar] - create new calendar

Calling Sequence

Calendar(name)

Parameters

name

-

string or name; calendar type

Description

• 

The Calendar command creates a calendar of the specified type and returns a module representing the new calendar. This data structure can be manipulated using the AddHoliday, JoinBusinessDays, JoinHolidays, and RemoveHoliday commands, and can also be used as a parameter to other commands from the Finance package.

• 

The parameter name is the type of the calendar. At present only Western-style calendars are supported. This includes Bratislava, Budapest, Copenhagen, Frankfurt, Helsinki, Milan, Johannesburg, London, Oslo, Prague, Stockholm, Sydney, Tokyo, Toronto, NewYork, Warsaw, Wellington and Zurich.

• 

In addition, two special calendars can be created: Null and Simple. Holidays in the Simple calendar are Saturdays, Sundays, and January 1st. The Null calendar does not have any holidays. Other calendars can be constructed using Null or Simple calendars as a base.

Examples

withFinance:

Create a sample calendar and modify it.

C:=CalendarNewYork:

IsHolidayDecember 26, 2006,C

false

(1)

IsBusinessDayDecember 26, 2006,C

true

(2)

AdvanceDateDecember 24, 2006,5,Days,C,output=formatted

January 2, 2007

(3)

Here is a Beijing calendar for the year 2004.

C2:=CalendarSimple:

NewYearDay:=seqAdvanceDateJanuary 1, 2004,i,i=0..6:

SpringFestival:=seqAdvanceDateJanuary 22, 2004,i,i=0..6:

LaborDay:=seqAdvanceDateMay 1, 2004,i,i=0..6:

NationalDay:=seqAdvanceDateOctober 1, 2004,i,i=0..6:

AddHolidayC2,NewYearDay,SpringFestival,LaborDay,NationalDay:

AdjustDateJanuary 23, 2004,C2,convention=Following,output=formatted

January 29, 2004

(4)

AdjustDateJanuary 23, 2004,C2,convention=Preceding,output=formatted

January 21, 2004

(5)

This calendar can be joined with the New York calendar.

C3:=JoinBusinessDaysC,C2

C3:=moduleend module

(6)

C4:=JoinHolidaysC,C2

C4:=moduleend module

(7)

IsHolidayJanuary 23, 2004,C

false

(8)

IsHolidayJanuary 23, 2004,C2

true

(9)

IsHolidayJanuary 23, 2004,C3

false

(10)

IsHolidayJanuary 23, 2004,C4

true

(11)

See Also

Finance[AddHoliday], Finance[AdjustDate], Finance[AdvanceDate], Finance[Calendars], Finance[IsBusinessDay], Finance[IsEndOfMonth], Finance[IsHoliday], Finance[JoinBusinessDays], Finance[JoinHolidays], Finance[RemoveHoliday]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam