1.0.5 • Published 14 days ago

react-jalali-gregorian-date-picker v1.0.5

Weekly downloads
-
License
-
Repository
-
Last release
14 days ago

React Jalali Gregorian Date Picker

The JalaliGregorianDatePicker component is a date picker designed for use in React applications. It allows users to select dates from both the Jalali and Gregorian calendars, offering flexibility and ease of use.

Installation

The package can be installed via npm:

npm install react-jalali-gregorian-date-picker --save

Usage

React Component:

import {JalaliGregorianDatePicker} from "./components";
import {useState} from "react";

function App() {
    const [visible,setVisible] = useState(false)
    const [dateRange,setDateRange] = useState([])
    
  return (
    <div>
        <input type="text" id="testInput" onFocus={() => setVisible(true)}/>

        <JalaliGregorianDatePicker
            dateRange={dateRange}
            setDateRange={(dateRange) => setDateRange(dateRange.map(date => date))}
            elementId="testInput"
            isVisible={visible}
            setIsVisible={setVisible}
        />
    </div>
  )
}

export default App

Props

Here are the props that can be passed to the <ReactTransition /> component:

Prop NameTypeDefault ValueDescription
colorStringblue(optional): Customize the color scheme of the date picker.
isDarkBooleanfalse(optional): Enable dark mode for the date picker.
setDateRangeFunctionundefiendA function to update the selected date range.
dateRangeArrayundefiendAn array representing the selected date range.
elementIdString''(optional): The ID of the input element to attach the date picker to.
isVisibleBooleantrue(optional): Control the visibility of the date picker.
setIsVisibleStringundefiend(optional): A function to update the visibility of the date picker.

Contributing

If you want to contribute to this project and make it better, your help is very welcome. Create an issue or submit a pull request.

1.0.5

14 days ago

1.0.4

14 days ago

1.0.2

15 days ago

1.0.1

15 days ago

1.0.3

15 days ago

1.0.0

15 days ago

0.0.0

6 months ago