@knutkirkhorn/week-number
v2.1.1
Published
Get the ISO 8601 week number of a date
Downloads
12
Readme
week-number
📅 Get the ISO 8601 week number of a date
Installation
npm install @knutkirkhorn/week-number
Usage
import weekNumber, {yesterdayWeekNumber, tomorrowWeekNumber} from '@knutkirkhorn/week-number';
console.log(weekNumber());
// => 36
console.log(weekNumber(new Date()));
// => 36
console.log(weekNumber('September 3, 2019 13:33:37'));
// => 36
console.log(yesterdayWeekNumber());
// => 36
console.log(tomorrowWeekNumber());
// => 36
API
weekNumber([date])
Returns the ISO 8601 week number of a date. If not date is passed, the current date is used.
yesterdayWeekNumber()
Returns the ISO 8601 week number of yesterday.
tomorrowWeekNumber()
Returns the ISO 8601 week number of tomorrow.
Related
- week-number-cli - CLI for this module