master
parent
cf505f0377
commit
7940eebde5
3 changed files with 56 additions and 30 deletions
@ -0,0 +1,38 @@ |
|||||||
|
import React 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"; |
||||||
|
|
||||||
|
const weekDays = [ |
||||||
|
"شنبه", |
||||||
|
"یکشنبه", |
||||||
|
"دوشنبه", |
||||||
|
"سشنبه", |
||||||
|
"چهارشنبه", |
||||||
|
"پنجشنبه", |
||||||
|
"جمعه", |
||||||
|
]; |
||||||
|
|
||||||
|
const Calender = () => { |
||||||
|
return ( |
||||||
|
<div className="calender-list"> |
||||||
|
<Calendar |
||||||
|
mapDays={({ date }) => { |
||||||
|
let props = {}; |
||||||
|
let isWeekend = date.weekDay.index === 6; |
||||||
|
|
||||||
|
if (isWeekend) props.className = "highlight highlight-red"; |
||||||
|
|
||||||
|
return props; |
||||||
|
}} |
||||||
|
weekDays={weekDays} |
||||||
|
arrow={false} |
||||||
|
calendar={persian} |
||||||
|
locale={persian_fa} |
||||||
|
/> |
||||||
|
</div> |
||||||
|
); |
||||||
|
}; |
||||||
|
|
||||||
|
export default Calender; |
Loading…
Reference in new issue