Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Build simple, lightweight React calendars & datepickers with a single hook
Build simple, lightweight React calendars & datepickers with a single hook
This module is distributed via [npm][npm] which is bundled with [node][node] and
should be installed as one of your project's dependencies
:
npm install --save calijs
This package also depends on
react
anddayjs
. Please make sure you have them installed as well. 👍
const {
date,
selectedDate,
nextMonth,
previousMonth,
nextYear,
previousYear,
selectDay,
getMonthDays,
setMonth,
setYear,
} = useCali();
The useCali()
hook returns the hook object based on now as the initial date.
Pass a different date to the hook such as useCali("12-19-1989");
to start at a different date.
dayjs()
The current date as a dayjs object
dayjs()
The selected date as a dayjs object
function()
Sets the date one month ahead
function()
Sets the date one month before
function()
Sets the current date one year ahead
function()
Sets the current date one year before
function(date)
Call with a date to set the selectedDate
function()
When called it turns a 42 item array of day objects ({ date: dayjs(), inMonth: boolean, isSelected: boolean })
to be used in 6 x 7 grid for calendars and datepickers
function(year) | year: string || number | optional
Sets the current year to the passed year. Year parameter can be a string or a number. If year is not valid it throws an invalid year error
function(month) | month: string || number | optional
Sets the current month to the passed month. Month parameter can be a string or a number from 0 - 11. If range is exceeded, it will be bubbled up to the year. If month is not valid it throws an invalid month error.
MIT
FAQs
Build simple, lightweight React calendars & datepickers with a single hook
The npm package calijs receives a total of 1 weekly downloads. As such, calijs popularity was classified as not popular.
We found that calijs 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.
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.
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.