
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
moment-working-days
Advanced tools
This is a Moment.js plugin that allows you to calculate working days considering sequence of date(s). You can customize the week off days, and also declare custom dates for holidays (eg: public holidays) to exclude them from being counted as working day(s
npm install moment-working-days
const WorkingDays = require('moment-working-days')
const WorkingDays = require('moment-working-days')
const momentWorkingdays = new WorkingDays({
includeToday: true,
verbose: true,
weekOffDays: [0, 6],
dateFormat: 'DD-MM-YYYY',
customHolidays: ['02-12-2019']
})
// includeToday: Include today in calculations, else today wll be excluded
// weekOffDays: Defines weekoff days. Note that week starts with day 0 (Sunday) to day 6 (Saturday).
// dateFormat: Moment Date Format in which dates will be passed
// customHolidays: Defines custom holidays for bussiness (eg: public holidays). Pass an array of dates in configured dateFormat
// Input
[
"29-11-2019",
"03-12-2019",
"07-12-2019",
"12-12-2019"
]
// Output
30-11-2019 is a Sat
01-12-2019 is a Sun
02-12-2019 is a Custom Holiday
07-12-2019 is a Sat
08-12-2019 is a Sun
Working Days: 6 day(s)
// Returns
6
// Explanation
- First it creates pairs of odd and even indexed dates.
- Then, it calculates days within a pair (eg: pair1: 29-11 and 03-12. pair2: 07-12 and 12-12).
- Then, it calculates overall working days.
- Hence giving support to distributed date ranges
// Input
[
"29-11-2019",
"03-12-2019",
"07-12-2019"
]
// Output
30-11-2019 is a Sat
01-12-2019 is a Sun
02-12-2019 is a Custom Holiday
07-12-2019 is a Sat
08-12-2019 is a Sun
Working Days: 3 day(s)
// Returns
3
// Explanation
- If number of elements in input array is odd, then it will pair the last date with today
- Eg: pair1: 29-11 and 03-12. pair2: 07-12 and 09-12 (Today's date)
- Hence giving support to distributed date ranges
// Input
[
"29-11-2019",
]
// Output
30-11-2019 is a Sat
01-12-2019 is a Sun
02-12-2019 is a Custom Holiday
07-12-2019 is a Sat
08-12-2019 is a Sun
Working Days: 6 day(s)
// Returns
6
.isWorkingday(<date>) => boolean
// Input
"02-12-2019"
// Output
02-12-2019 is a Custom Holiday
// Returns
false
// Input
"01-12-2019"
// Output
01-12-2019 is a Sun
// Returns
false
// Input
"06-12-2019"
// Returns
true
FAQs
This is a Moment.js plugin that allows you to calculate working days considering sequence of date(s) - similar to start-stop timer sequence. You can customize the week off days, and also declare custom dates for holidays (eg: public holidays) to exclude t
The npm package moment-working-days receives a total of 264 weekly downloads. As such, moment-working-days popularity was classified as not popular.
We found that moment-working-days 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.