Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```