Options
All
  • Public
  • Public/Protected
  • All
Menu

calendar class

This class provides methods for determining whether a date is a business day or a holiday for a given market, and for incrementing/decrementing a date of a given number of business days.

The Bridge pattern is used to provide the base behavior of the calendar, namely, to determine whether a date is a business day.

A calendar should be defined for specific exchange holiday schedule or for general country holiday schedule. Legacy city holiday schedule calendars will be moved to the exchange/country convention.

test

the methods for adding and removing holidays are tested by inspecting the calendar before and after their invocation.

Hierarchy

Index

Constructors

constructor

  • Returns Calendar

Properties

Protected _impl

_impl: Impl

Private _isDisposed

_isDisposed: boolean

Accessors

isDisposed

  • get isDisposed(): boolean
  • Returns boolean

Methods

addHoliday

  • addHoliday(d: Date): void
  • Parameters

    • d: Date

    Returns void

adjust

  • Parameters

    Returns Date

advance1

  • Parameters

    Returns Date

advance2

  • Parameters

    Returns Date

businessDaysBetween

  • businessDaysBetween(from: Date, to: Date, includeFirst?: boolean, includeLast?: boolean): Day
  • Parameters

    • from: Date
    • to: Date
    • Default value includeFirst: boolean = true
    • Default value includeLast: boolean = false

    Returns Day

dispose

  • dispose(): void
  • Returns void

empty

  • empty(): boolean
  • Returns boolean

endOfMonth

  • endOfMonth(d: Date): Date
  • Parameters

    • d: Date

    Returns Date

isBusinessDay

  • isBusinessDay(d: Date): boolean
  • Parameters

    • d: Date

    Returns boolean

isEndOfMonth

  • isEndOfMonth(d: Date): boolean
  • Parameters

    • d: Date

    Returns boolean

isHoliday

  • isHoliday(d: Date): boolean
  • Parameters

    • d: Date

    Returns boolean

isWeekend

  • Parameters

    Returns boolean

name

  • name(): string
  • Returns string

removeHoliday

  • removeHoliday(d: Date): void
  • Parameters

    • d: Date

    Returns void

Static equal

  • Parameters

    Returns boolean

Static holidayList

  • holidayList(calendar: Calendar, from: Date, to: Date, includeWeekEnds?: boolean): Date[]
  • Parameters

    • calendar: Calendar
    • from: Date
    • to: Date
    • Default value includeWeekEnds: boolean = false

    Returns Date[]