scdate
v1.0.1
Published
**Date and time library for dealing with schedules.**
Downloads
32
Maintainers
Readme
scDate
Date and time library for dealing with schedules.
Features:
- Supports dates, times, time stamps, and active weekdays
- Time zone required for operations only when relevant
- Serializable to simple ISO formatted strings
Dependencies
This package has the following dependencies:
date-fns-tz
: used for time zone calculationsdate-fns
: it is a peer dependency ofdate-fns-tz
@date-fns/utc
: used for itsUTCDateMini
implementation that simplifies some of the time calculations
Design Decisions
ISO formatted values
A subset of ISO 8601 is used as the valid format for SDate, STime, and STimestamp. This was done because:
- the format is human readable
- the values are easily sortable as strings
- the values are easily comparable as strings
No seconds in time components
The library was designed with schedules in mind that do not require second or smaller granularity as such STime and STimestamp only provide minute granularity.
Time zones
For a list of valid time zones run Intl.supportedValuesOf('timeZone')
in your environment.
API Reference
See docs