update src/components/DateRangePicker/index.js

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

@ -1,6 +1,5 @@
import React from "react";
import DatePicker from "react-multi-date-picker";
import { Calendar } from "react-multi-date-picker";
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 = () => {
return (
<>
<Calendar
arrow={<div style={{ backgroundColor: "red" }}>arrow</div>}
range
calendar={persian}
locale={persian_fa}
weekDays={weekDays}
minDate={new Date()}
renderButton={<CustomButton />}
// render={<CustomRangeInput />}
calendarPosition="bottom-right"
plugins={[<DatePanel position="bottom" />]}
/>

Loading…
Cancel
Save