diff --git a/src/components/DateRangePicker/index.js b/src/components/DateRangePicker/index.js index 90ea8e6..93af355 100644 --- a/src/components/DateRangePicker/index.js +++ b/src/components/DateRangePicker/index.js @@ -1,10 +1,11 @@ -import React from "react"; +import React, { useState, useEffect } from "react"; import { Calendar } from "react-multi-date-picker"; import persian from "react-date-object/calendars/persian"; import persian_fa from "react-date-object/locales/persian_fa"; import DatePanel from "react-multi-date-picker/plugins/date_panel"; +import DatePicker from "react-multi-date-picker"; const weekDays = [ "شنبه", @@ -32,35 +33,39 @@ function CustomButton({ direction, handleClick, disabled }) { ); } -// function CustomRangeInput({openCalendar, value}) { -// let from = value[0] || "" -// let to = value[1] || "" +function CustomRangeInput({ openCalendar, value }) { + // let from = value[0] || ""; + // let to = value[1] || ""; -// value = from && to ? "از " + from + "، تا " + to": from + // value = from && to ? "از " + from + "، تا " + to": from + useEffect(() => { + openCalendar(); + }, []); -// return ( -// -// ) -// } + return ( +