Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aquaron/time
Time utilities
https://github.com/aquaron/time
converter nodejs npmjs time
Last synced: 3 months ago
JSON representation
Time utilities
- Host: GitHub
- URL: https://github.com/aquaron/time
- Owner: aquaron
- License: mit
- Created: 2020-10-14T18:46:48.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-10T02:40:04.000Z (4 months ago)
- Last Synced: 2024-09-29T13:41:00.513Z (4 months ago)
- Topics: converter, nodejs, npmjs, time
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@aquaron/time
- Size: 914 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# @aquaron/time [![codeql]][scanning] [![tests]][issues] [![npmjs]][package] ![badge-time]
Collection of date/time related utilities.
## Usage
Function | Return
--- | ---
`isUpcoming('2020-03-17')` | `false`
`timeLeft(1000)` | Object containing `{... seconds: 1}`
`timeLeftStr(1000)` | `1 second`
`nextDow(6)` | `Date` object of next Saturday
`prevDow(3)` | `Date` object of prev Wednesday
`toDate('2020-03-17')` | `Date` object
`toYMD(new Date())` | Today's date in `YYYY-MM-DD`
`toPrettyDate('2020-03-17')` | `Tuesday, Mar 30, 2020, 12:00 AM`[codeql]: https://github.com/aquaron/time/workflows/codeql/badge.svg
[tests]: https://github.com/aquaron/time/workflows/tests/badge.svg
[npmjs]: https://github.com/aquaron/time/workflows/npmjs/badge.svg[scanning]: https://github.com/aquaron/time/security/code-scanning
[issues]: https://github.com/aquaron/time/issues
[package]: https://www.npmjs.com/package/@aquaron/time
[badge-time]: https://img.shields.io/npm/v/@aquaron/time?label=time&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4MDAgODAwIj48cGF0aCBmaWxsPSIjMzMzIiBkPSJNODAwIDQwMEE0MDAgNDAwIDAgMDA0MDAgMCA0MDAgNDAwIDAgMDAwIDQwMGE0MDAgNDAwIDAgMDA0MDAgNDAwIDQwMCA0MDAgMCAwMDQwMC00MDB6Ii8+PHBhdGggZmlsbD0iI2ZmZGU3NSIgZD0iTTQwMCAxMTMuNmMtNTUuNSAxNjUuMy0yMDkuNiAyMTUtMjA5LjYgMzc5LjIgMCAxMDcgMTAyLjcgMTkzLjYgMjA5LjYgMTkzLjYgMTA2LjcgMCAyMDkuNi04Ni43IDIwOS42LTE5My42IDAtMTU5LjItMTQ0LTIxMC43LTIwOS42LTM3OS4yem0wIDUzMi41Yzg0LjUtMTM5LjctNTMuMy0zMzYuNSAxLjMtNDQwIDI0LjggNDAgNTIuNiA3My4xIDc4LjIgMTAzLjggNTAuMSA1OS43IDg5LjggMTA2LjYgODkuOCAxODIuOSAwIDgwLTgwLjggMTUzLjMtMTY5LjMgMTUzLjN6Ii8+PHBhdGggZD0iTTQwMCAwdjIwOC41Yy0xOS4zIDM5LjQtMTIgOTEuNyAwIDE0OSAxOS43IDk0LjQgNTIuMiAyMDIuMyAwIDI4OC41djE1NGE0MDAgNDAwIDAgMDA0MDAtNDAwQTQwMCA0MDAgMCAwMDQwMCAweiIgb3BhY2l0eT0iLjUiLz48L3N2Zz4K&color=ffde75