Skip to content

Alheimsins/uker-fra-dato

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 

js-standard-style

uker-fra-dato

Count weeks from a given date or between two dates.

Returns 0 for end date in the past.

Does only calculate from date and not time.

Usage

const wfd = require('@alheimsins/uker-fra-dato')
const start = new Date('2020-09-07')
const endOne = new Date('2020-09-13')
const endTwo = new Date('2020-09-14')
const endPast = new Date('2019-05-01')

console.log(wfd(start, endOne)) //=> 0
console.log(wfd(start, endTwo)) // => 1
console.log(wfd(start, endPast)) // => 0

License

MIT

About

Created with for Alheimsins

Alheimsins logo

About

Count weeks from a given date

Resources

License

Stars

Watchers

Forks

Packages

No packages published