Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryanburnette/seconds-to-next-sunday-midnight
https://github.com/ryanburnette/seconds-to-next-sunday-midnight
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ryanburnette/seconds-to-next-sunday-midnight
- Owner: ryanburnette
- Created: 2024-12-22T02:36:30.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-22T02:50:27.000Z (about 2 months ago)
- Last Synced: 2024-12-22T03:23:08.185Z (about 2 months ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# seconds-to-next-sunday-midnight
`seconds-to-next-sunday-midnight` is a JavaScript library to calculate the number of seconds until the next Sunday at midnight based on a given date and time zone.
## Usage
```javascript
const secondsToNextSundayMidnight = require('seconds-to-next-sunday-midnight');const localeDate = new Date('2024-04-23T10:00:00Z');
const timeZone = 'UTC';
const seconds = secondsToNextSundayMidnight(localeDate, timeZone);console.log(seconds); // Outputs: 396000
```## Testing
```bash
npm test
```