🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@alheimsins/uker-fra-dato

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alheimsins/uker-fra-dato

Count weeks from a given date

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
2
Created
Source

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

Keywords

weeks from date

FAQs

Package last updated on 16 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts