0.2.3 • Published 2 days ago

scdate v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 days ago

scDate

Date and time library for dealing with schedules.

github license npm version

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 calculations
  • date-fns: it is a peer dependency of date-fns-tz
  • @date-fns/utc: used for its UTCDateMini 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

0.2.3

2 days ago

0.2.2

15 days ago

0.2.1

18 days ago

0.2.0

18 days ago

0.1.1

20 days ago