https://github.com/naturalcycles/time-lib
Date/time related API, based on DayJS
https://github.com/naturalcycles/time-lib
api date dayjs time
Last synced: about 2 months ago
JSON representation
Date/time related API, based on DayJS
- Host: GitHub
- URL: https://github.com/naturalcycles/time-lib
- Owner: NaturalCycles
- Created: 2019-05-18T23:58:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-21T14:04:02.000Z (over 1 year ago)
- Last Synced: 2025-01-24T12:32:31.911Z (3 months ago)
- Topics: api, date, dayjs, time
- Language: TypeScript
- Homepage:
- Size: 1.91 MB
- Stars: 1
- Watchers: 13
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
## @naturalcycles/time-lib
> Date/time API, based on Dayjs.
[](https://www.npmjs.com/package/@naturalcycles/time-lib)
[](https://bundlephobia.com/result?p=@naturalcycles/time-lib)
[](https://github.com/prettier/prettier)# Why
- Fixes TypeScript imports, regardless if esModuleInterop is used or not
- ~~Allows to use it as ESM package with tree-shaking (without breaking your TypeScript again)~~
- Opinionated. Includes "needed" dayjs plugins by default.
- Allows to "just import dayjs" and not worry about:
- Loading plugins for all of your "entry points", such as `startServer.ts`, `setupJest.ts`, at
every cron job, etc.
- That plugins are loaded BEFORE they are used (dependent on import order)
- That TypeScript types are not loaded with plugins
- Extends dayjs with some useful functions (via Plugin interface)
- Has working `isoWeekday` plugin
- Has `en-gb` locale by default, so, default firstDayOfWeek is Monday# API
TODO