0.1.0 • Published 1 year ago

@skhazaei/persian-date-picker v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Persian Date Picker

Persian Date Picker is a lightweight and user-friendly date picker component for React, specifically designed to support the Persian calendar. It offers a seamless two-way conversion between Jalaali and Gregorian dates, making it ideal for developers looking to incorporate the Persian calendar into their React projects. With this package, users can easily choose a date or time period, while also having access to a wide range of standard time formats based on Gregorian dates, including UTC and more. Overall, the Persian Date Picker is a highly versatile and reliable option for anyone looking to integrate a Persian calendar into their React application.


Installation

To install persian-date-picker, you will need to have npm or yarn installed on your system. Once you have one of these package managers set up, you can install persian-date-picker by running the following command:

npm i @skhazaei/persian-date-picker

or

yarn add @skhazaei/persian-date-picker

This will install the latest version of jalaali-react-date-picker and add it as a dependency to your project.


Usage

Calendar type

import PersianDatePicker from '@skhazaei/persian-date-picker'

function App() {
  return <PersianDatePicker input={false} />
}

Gregorian Calendar

to use it, you have to pass isGregorian={true} to the component:

import PersianDatePicker from '@skhazaei/persian-date-picker'

function App() {
  return <PersianDatePicker input={false} isGregorian={true} />
}

Options

PropertyTypeDescription
inputbooleanby defalut, calendar has an input to show its value. if you want only use calendar without input you have to pass false value
isGregorianbooleanby defalut, this value is false.
selectedDayDate | null-
onSelectDayDate-
minDateDate | nullif you want to disable days before a special day, you need to pass your date as property to the component.
maxDateDate | nullif you want to disable days a after special day, you need to pass your date as property to the component.
isRangebooleanWhen you want use calendar as range picker, you have to add isRange={true} as a property to the component. it need also 
rangeDaysDate | null , Date | nullIt accept an array of two values. the first as first date and the last one as last date.
onSelectRangeDate,DateIt will return an array of selected range of dates.
selectedBackgroundColorhex-
selectedTextColorhex-
rangeBackgroundColorhex-
0.1.0

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago