
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
date-picker-nextjs
Advanced tools
A datepicker component built with Next.js using FontAwesome
npm i date-picker-nextjs
Or :
yarn add date-picker-nextjs
Or :
pnpm add date-picker-nextjs
import { DatePicker } from 'date-picker-nextjs'
import { useState } from 'react'
const Example = () => {
const [modalDateIsOpen, setModalDateIsOpen] = useState(false)
const [clickedInput, setClickedInput] = useState(null)
const handleDatePicker = (e) => {
setClickedInput(e.target.id)
setModalDateIsOpen(true)
}
const submit = (e) => {
e.preventDefault()
// your logic
}
return (
<>
<form className="test" onSubmit={submit}>
<label htmlFor="birthdate">Birthdate</label>
<input
className="input-field outline-none"
type="text"
id="dateOfBirth"
placeholder="Date of birth"
onClick={handleDatePicker}
/>
<input type="submit" value="Submit" />
</form>
{modalDateIsOpen && (
<DatePicker
setModalDateIsOpen={setModalDateIsOpen}
clickedInput={clickedInput}
/>
)}
</>
)
}
export default Example
setModalDateIsOpen
: This state function is mandatory and will allow the date picker modal to close itself | Required
clickedInput
: The id of the input filed to attach the date picker modal to
| Required
endYear
: The last year to display. Default : current year | Optional
yearCount
: The nomber of years to display. Default : 100 | Optional
Author : Pierre-Yves Léglise
FAQs
Date Picker component created for Next.js projects
The npm package date-picker-nextjs receives a total of 52 weekly downloads. As such, date-picker-nextjs popularity was classified as not popular.
We found that date-picker-nextjs 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.