Options
All
  • Public
  • Public/Protected
  • All
Menu

A set of utilities for working with calendar time.

Index

Variables

Const END_OF_TIME

END_OF_TIME: Date = ...

Date a century in the future.

Const END_OF_YEARS

END_OF_YEARS: Tagged<"Year", number> = ...

Year number a century in the future.

Let END_YEAR

END_YEAR: Tagged<"Year", number> = ...

Default to 50 years.

Const THIS_YEAR

THIS_YEAR: Date = ...

This year as a Date referring to January 1.

Const TODAY

TODAY: Date = ...

Today as a Date, starting at midnite (UTC).

Const YEAR

YEAR: Tagged<"Year", number> = ...

This year as a 4-digit number.

Functions

Const calculate_age

  • calculate_age(birth: Date, thisDate: Date): Age

Const dayOfYear

  • dayOfYear(date: Date): number

Const day_of_year

  • day_of_year(d: Date): number
  • Obtain the day number of a given Date

    Parameters

    • d: Date

      The given Date.

    Returns number

    number of days since January 1

Const year

  • year(d: Date): Date

Const yearDays

  • yearDays(year: number): 366 | 365
  • The number of days in a particular year.

    Parameters

    • year: number

      The year as a number

    Returns 366 | 365

    365 or 366

Generated using TypeDoc