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.
react-multi-date-picker
Advanced tools
a simple React datepicker component for work with persian and georgian calendars
npm install --save react-multi-date-picker
import react from "react";
import DatePicker from "react-multi-date-picker";
export default function Example() {
return <DatePicker />;
}
Key | value | default |
---|---|---|
date | Date, DateObject, String or Number | new Date() |
timePicker | Boolean | false |
onlyTimePicker | Boolean | false |
liveChange | Boolean | false |
format | String | YYYY/MM/DD |
local | en or fa | en |
calendar | gregorian, persian or arabic | gregorian |
onChange | Function | - |
<DatePicker
date={new Date()}
/>
<DatePicker
date={new Date(2020,9,27)}
/>
<DatePicker
date="2020/08/27"
/>
<DatePicker
date="2020/27/08"
format="YYYY/DD/MM"
/>
<DatePicker
date="August 27 2020"
format="MMMM DD YYYY"
/>
<DatePicker
date="2020/08/27 12:30:31"
format="YYYY/MM/DD HH:mm:ss"
timePicker
/>
<DatePicker
date={new Date()}
format="YYYY-MM-DD HH:mm:ss"
timePicker
/>
<DatePicker
date="August 27 2020 12:30:31 am"
format="MMMM DD YYYY hh:mm:ss a"
timePicker
/>
<DatePicker
date="12:30:31 am"
format="hh:mm:ss a"
onlyTimePicker
/>
<DatePicker
date={new Date()}
format="hh-mm-ss A"
onlyTimePicker
/>
<DatePicker
date={new Date()}
format="YYYY/MM/DD hh:mm:ss a"
timePicker
onChange={(stringDate,dateObject)=>{
console.log(stringDate,dateObject.toDate())
}}
/>
<DatePicker
date="2020/08/27 11:10:59 am"
format="YYYY/MM/DD hh:mm:ss a"
timePicker
onChange={(stringDate, dateObject)=>{
if(dateObject.isValid){
console.log(stringDate)
}
}}
/>
<DatePicker
date="2020/08/27 11:10:59 am"
format="YYYY/MM/DD hh:mm:ss a"
timePicker
onChange={(stringDate, dateObject)=>{
if(dateObject.weekDay.name === "Friday" ){
console.log(dateObject.format())
}
}}
/>
<DatePicker
date={new Date()}
format="YYYY/MM/DD hh:mm:ss a"
calendar="persian"
local="fa"
timePicker
onChange={(stringDate,dateObject)=>{
console.log(stringDate,dateObject.convert("gregorian"))
}}
/>
<DatePicker
date="1399/06/05 12:30:24 pm"
format="YYYY/MM/DD hh:mm:ss a"
calendar="persian"
local="en"
timePicker
/>
<DatePicker
calendar="arabic"
local="ar"
/>
FAQs
A simple React datepicker component for working with gregorian, persian, arabic and indian calendars with the ability to select the date by single, multiple, range and multiple range pickers.
The npm package react-multi-date-picker receives a total of 56,287 weekly downloads. As such, react-multi-date-picker popularity was classified as popular.
We found that react-multi-date-picker 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.
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.