1.1.0 • Published 3 years ago

datepicker-jalali-react v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

datepicker-jalali-react

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save datepicker-jalali-react

Demo

https://matinrezakhani.github.io/datepicker-jalali-react/

Date Picker Jalali

propstypedefault
valuetimestamp | Date | MomentDateMomenttoday date
localestring ('fa','en')fa
disableDatebooleandefault is false
disableTimebooleandefault is false
onChangefunctionthis 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