Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
dayjs-banking-days
Advanced tools
This is a Day.js plugin that is meant to provide efficient ways for getting US banking days.
This is a Day.js plugin that is meant to provide efficient ways for getting US banking days.
Install via Bun, Yarn or NPM
bun add dayjs-banking-days
yarn add dayjs-banking-days
npm install dayjs-banking-days
By default, this plugin considers the following holidays:
The following functionality is provided:
You will need to import the plugin and activate it via the Day.js .extend()
function
import dayjs from 'dayjs'
import dayjsBankingDays from 'dayjs-banking-days'
dayjs.extend(dayjsBankingDays)
You can include custom dates by passing in an object that contains the one or both of the following properties:
fixedDateHolidays
floatingDateHolidays
Fixed date holidays always occur on the same date each year and are represent as a string with the format MM-DD
, e.g. May 4th (Star Wars Day) would be 05-04
. Floating date holidays occur on a specific day of the month, represented with an object comprised of the key being the month, an array where the first element is the day, followed by the occurence count in the month, e.g. Columbus Day is the 2nd Monday in October and would be represented { 10: [1, 2]}
.
import dayjs from 'dayjs'
import dayjsBankingDays from 'dayjs-banking-days'
dayjs.extend(dayjsBankingDays, {
fixedDateHolidays: ['05-04'],
floatingDateHolidays: {
10: [1, 2],
},
})
To determine if it's a holiday
const isBankingDay: boolean = dayjs().isBankingDay()
To determine if it's a banking holiday
const isBankingHoliday: boolean = dayjs().isBankingHoliday()
To add banking days
const newDay: dayjs.Dayjs = dayjs().addBankingDays(2) // Adds 2 days
To subtract banking days
const newDay: dayjs.Dayjs = dayjs().subtractBankingDays(7) // Subtracts 7 days
FAQs
This is a Day.js plugin that is meant to provide efficient ways for getting US banking days.
The npm package dayjs-banking-days receives a total of 19 weekly downloads. As such, dayjs-banking-days popularity was classified as not popular.
We found that dayjs-banking-days demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.