|
|
@ -1,8 +1,12 @@ |
|
|
|
import React, { useState } from 'react'; |
|
|
|
import React, { useState } from 'react'; |
|
|
|
import DatePicker from "react-modern-calendar-datepicker"; |
|
|
|
import DatePicker, {utils} from "react-modern-calendar-datepicker"; |
|
|
|
import '../Calendar/index.css'; |
|
|
|
import '../Calendar/index.css'; |
|
|
|
const SimpleDatePicker = () =>{ |
|
|
|
const SimpleDatePicker = (props) =>{ |
|
|
|
const [selectedDay, setSelectedDay] = useState(null); |
|
|
|
const [selectedDay, setSelectedDay] = useState(null); |
|
|
|
|
|
|
|
const gotoToday = () =>{ |
|
|
|
|
|
|
|
setSelectedDay(utils('fa').getToday()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return( |
|
|
|
return( |
|
|
|
<div className='flex items-center justify-center w-full my-2'> |
|
|
|
<div className='flex items-center justify-center w-full my-2'> |
|
|
|
<DatePicker |
|
|
|
<DatePicker |
|
|
@ -10,6 +14,7 @@ const SimpleDatePicker = () =>{ |
|
|
|
onChange={setSelectedDay} |
|
|
|
onChange={setSelectedDay} |
|
|
|
inputPlaceholder="انتخاب تاریخ" |
|
|
|
inputPlaceholder="انتخاب تاریخ" |
|
|
|
shouldHighlightWeekends |
|
|
|
shouldHighlightWeekends |
|
|
|
|
|
|
|
renderFooter={() => <button onClick={gotoToday}>برو به امروز</button>} |
|
|
|
locale='fa' |
|
|
|
locale='fa' |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|