update src/components/DateRangePicker/index.js

master
Your Name 3 years ago
parent 73e1f0321a
commit 09d76d6d63
  1. 18
      src/components/DateRangePicker/index.js

@ -1,6 +1,5 @@
import React from "react"; import React from "react";
import DatePicker from "react-multi-date-picker";
import { Calendar } from "react-multi-date-picker"; import { Calendar } from "react-multi-date-picker";
import persian from "react-date-object/calendars/persian"; import persian from "react-date-object/calendars/persian";
@ -33,16 +32,33 @@ function CustomButton({ direction, handleClick, disabled }) {
); );
} }
// function CustomRangeInput({openCalendar, value}) {
// let from = value[0] || ""
// let to = value[1] || ""
// value = from && to ? "از " + from + "، تا " + to": from
// return (
// <input
// onFocus={openCalendar}
// value={value}
// readOnly
// />
// )
// }
const DateRangePicker = () => { const DateRangePicker = () => {
return ( return (
<> <>
<Calendar <Calendar
arrow={<div style={{ backgroundColor: "red" }}>arrow</div>}
range range
calendar={persian} calendar={persian}
locale={persian_fa} locale={persian_fa}
weekDays={weekDays} weekDays={weekDays}
minDate={new Date()} minDate={new Date()}
renderButton={<CustomButton />} renderButton={<CustomButton />}
// render={<CustomRangeInput />}
calendarPosition="bottom-right" calendarPosition="bottom-right"
plugins={[<DatePanel position="bottom" />]} plugins={[<DatePanel position="bottom" />]}
/> />

Loading…
Cancel
Save