ts-time/TimeField

Consumption

import TimeField, {HOUR_FIELD, HOUR12_FIELD, MINUTE_FIELD, SECOND_FIELD, MS_FIELD} from "ts-time/TimeField";

Default export#

Polymorph interface of a numeric linearly-distributed field of LocalTime.

This is an experimental API. There's a higher chance that the authors of the library may remove or change it in future releases.

get#

(time: LocalTime): number

time
Time to obtain a field from.
returns
Field value.
getDuration#

(): Duration

returns
Duration between two respective values of the field.

HOUR_FIELD#

HOUR_FIELD: TimeField

Hour field (0-23).

HOUR12_FIELD#

HOUR12_FIELD: TimeField

12-hour field (0-11).

MINUTE_FIELD#

MINUTE_FIELD: TimeField

Minute field (0-59).

SECOND_FIELD#

SECOND_FIELD: TimeField

Second field (0-59).

MS_FIELD#

MS_FIELD: TimeField

Millisecond field (0-999).