1.1.0 • Published 3 years ago
datepicker-jalali-react v1.1.0
datepicker-jalali-react
Made with create-react-library
Install
npm install --save datepicker-jalali-react
Demo
https://matinrezakhani.github.io/datepicker-jalali-react/
Date Picker Jalali
props | type | default | ||
---|---|---|---|---|
value | timestamp | Date | Moment | Date | Moment | today date |
locale | string ('fa','en') | fa | ||
disableDate | boolean | default is false | ||
disableTime | boolean | default is false | ||
onChange | function | this function will be called when the date or time changed |
Usage
import React, { useState } from 'react'
import Datepicker from 'datepicker-jalali-react'
const App = () => {
const [date, setDate] = useState('')
const handleDatepicker = (e) => {
console.log(e)
setDate(e)
}
return (
<div>
<Datepicker
value={date}
onChange={(e) => {
handleDatepicker(e)
}}
/>
<Datepicker
value={date}
disableTime
onChange={(e) => {
handleDatepicker(e)
}}
/>
<Datepicker
value={date}
disableDate
onChange={(e) => {
handleDatepicker(e)
}}
/>
</div>
)
}
License
MIT © matinrezakhani