
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@alheimsins/virkedager
Advanced tools
Simple tool for calculating working days.
Input a date object and an optional number of working days (defaults to 2). Get a date string in return.
The module starts counting working days from the day after input date. It will skip saturdays, sundays and all Norwegian public holidays.
const virkedager = require('@alheimsins/virkedager')
const date = new Date('2020-04-07')
console.log(virkedager(date, 3)) // => 2020-04-15
Input a date object and get true/false if given date is a workingday.
const { isVirkedag } = require('@alheimsins/virkedager')
const dateHoliday = new Date('2020-09-20')
const dateWorkingday = new Date('2020-09-21')
console.log(isVirkedag(dateHoliday)) // => false
console.log(isVirkedag(dateWorkingday)) // => true
Input a date object and get true/false if given date is between two holidays.
const { erInneklemtDag } = require('@alheimsins/virkedager')
const dateInneklemt = new Date('2021-05-14')
const dateNotInneklemt = new Date('2021-05-18')
console.log(erInneklemtDag(dateInneklemt)) // => true
console.log(erInneklemtDag(dateNotInneklemt)) // => false
Input a date object and get true/false if given week got 3 or less working days.
const { erInneklemtUke } = require('@alheimsins/virkedager')
const dateInneklemt = new Date('2022-04-14')
const dateNotInneklemt = new Date('2022-04-04')
console.log(erInneklemtUke(dateInneklemt)) // => true
console.log(erInneklemtUke(dateNotInneklemt)) // => false
Created with ❤ for Alheimsins

FAQs
Simple module for calculating working days
The npm package @alheimsins/virkedager receives a total of 807 weekly downloads. As such, @alheimsins/virkedager popularity was classified as not popular.
We found that @alheimsins/virkedager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.