0.0.1 • Published 5 years ago

test-react-jalali-datepicker v0.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Jalali React Date-Picker

Build Status All Contributors

alt-text

React component that helps you to makes simple Farsi/Jalali/Shamsi date picker. It also has range date picker you can select multiple days in multiple months.

Installation

$ npm install -S jalali-react-datepicker

Date Picker

propstypedefault
valuetimestamp | Date | MomentDateMomenttoday date
weekendnumber[][6]
ArrowLeftReact.ReactTypedefault component
ArrowLeftReact.ReactTypedefault component
ClockIconReact.ReactTypedefault component
DateIconReact.ReactTypedefault component
timePickerbooleantrue.
onClickSubmitButtonfunctionnull. if you passed this will be something like
modalZIndexnumber9999
themeobjectdefault theme you can see here
labelstringdefault is null

usage

import React from "react";
import { render } from "react-dom";
import { DatePicker } from "jalali-react-datepicker";

render(<DatePicker />, document.getElementById("root"));

onClickSubmitButton

You can access to datePicker value when submit button is clicked.

example:

function submitExample({ value }) {
  console.log("value ", value);
}

Range Date Picker

You can make range date picker with this component. In the below table you can see all the props you can pass to this component.

Note that all props are optional.

propstypedefault
startstring. ex: 1397/5/18today date
endstring. ex: 1397/5/18today date
weekendnumber[][6]
ArrowLeftReact.ReactTypedefault component
ArrowRightReact.ReactTypedefault component
isRenderingButtonsbooleantrue. if it is false rangeDatePicker doesnt show submit and cancel buttons
onClickSubmitButtonfunctionnull. if you passed this will be something like this
modalZIndexnumber9999
themeobjectdefault theme you can see here
fromLabelstringdefault is از تاریخ
toLabelstringdefault is تا تاریخ

usage

import React from "react";
import { render } from "react-dom";
import { RangeDatePicker } from "jalali-react-datepicker";

render(<RangeDatePicker />, document.getElementById("root"));

onClickSubmitButton

You can access to start and end date when submit button is clicked.

example:

function submitExample({ start, end }) {
  console.log("start ", start);
  console.log("end ", end);
}

ToDo

  • write DatePicker
  • add label to inputs
  • create codesandbox page for preview
  • add TimePicker

Contributors

Thanks goes to these wonderful people (emoji key):

Reza Khosroshahi💻 📖 💡 🤔 ⚠️saeedjalali💬 🐛 💻 🤔 👀 📢

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT License