Skip to main content

types

Chronosis uses TypeScript for development, so

DateLike

type DateLike = Date | (string & {}) | number

DateLike generally represents anything that can be passed into a Date constructor. It's used to describe the input of constructor.

TimeUnit

type TimeUnit =
| 'millisecond'
| 'second'
| 'minute'
| 'hour'
| 'day'
| 'month'
| 'year'

TimeUnit represents every unit of time considered by Chronosis. It's used to describe the input of manipulation functions (get, set, add, subtract, startOf, and endOf),