Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
moment-business
Advanced tools
Utilities for working with week days and work days in Moment. It assumes a Western workweek, wherein weekends are Saturday and Sunday.
Moment is an indispensable tool for working with dates in Javascript, but it doesn't supply methods for working with week days or weekend days (at least, not yet).
This library supplies you with those missing tools.
There are alternative libraries for these methods, but this one uses constant-time algorithms, and not loops. Loops are easier for a human to write, but they are slower for a computer to resolve.
workDays( otherMoment )
Calculate the number of work days between the moment and otherMoment
. Work days are Monday through Friday.
weekendDays( otherMoment )
Calculate the number of weekend days between the moment and otherMoment
. Weekend days are Saturday and Sunday.
addWorkDays( amount )
Add work days to a moment, modifying the original moment. Returns the moment.
subtractWorkDays( amount )
Subtract work days from the moment, modifying the original moment. Returns the moment.
isWorkDay()
Whether or not the Moment occurs between Monday and Friday.
isWekendDay()
Whether or not the Moment occurs on Saturday or Sunday.
FAQs
Methods to work with week days and weekends in moment.
We found that moment-business demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.