Options
All
  • Public
  • Public/Protected
  • All
Menu

Simple day counter for reproducing theoretical calculations.

This day counter tries to ensure that whole-month distances are returned as a simple fraction, i.e., 1 year = 1.0, 6 months = 0.5, 3 months = 0.25 and so forth.

warning this day counter should be used together with NullCalendar, which ensures that dates at whole-month distances share the same day of month. It is not guaranteed to work with any other calendar.

test the correctness of the results is checked against known good values.

Hierarchy

Index

Classes

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Returns SimpleDayCounter

Properties

Protected _impl

_impl: Impl

Static fallback

fallback: Thirty360 = new Thirty360()

Accessors

isDisposed

  • get isDisposed(): boolean

Methods

dayCount

  • dayCount(d1: Date, d2: Date): number
  • Parameters

    • d1: Date
    • d2: Date

    Returns number

dispose

  • dispose(): void

empty

  • empty(): boolean
  • Returns boolean

name

  • name(): string
  • Returns string

yearFraction

  • yearFraction(d1: Date, d2: Date, refPeriodStart?: Date, refPeriodEnd?: Date): Time
  • Parameters

    • d1: Date
    • d2: Date
    • Default value refPeriodStart: Date = null
    • Default value refPeriodEnd: Date = null

    Returns Time

Static equal