Skip to content

knutkirkhorn/week-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

31 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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

About

๐Ÿ“… Get the ISO 8601 week number of a date

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •