پراپ ها
پراپ | حالت | پیش فرض |
---|---|---|
position | String | "right" |
disabled | Boolean | false |
className | String | |
sort | Array | ["today", "deselect", "close"] |
names | Object | en:
fa:
|
نوار ابزار پیشفرض
import React, { useState } from "react"
import Toolbar from "react-multi-date-picker/plugins/toolbar"
import persian from "react-date-object/calendars/persian"
import persian_fa from "react-date-object/locales/persian_fa"
.
.
.
const [value, setValue] = useState()
.
.
.
<DatePicker
value={value}
onChange={setValue}
plugins={[
<Toolbar position="bottom" />
]}
calendar={persian}
locale={persian_fa}
calendarPosition="bottom-right"
/>
تغییر چینش دکمه ها
import React, { useState } from "react"
import Toolbar from "react-multi-date-picker/plugins/toolbar"
import persian from "react-date-object/calendars/persian"
import persian_fa from "react-date-object/locales/persian_fa"
.
.
.
const [value, setValue] = useState()
.
.
.
<DatePicker
value={value}
onChange={setValue}
plugins={[
<Toolbar
position="bottom"
sort={["deselect", "close", "today"]}
/>,
]}
calendar={persian}
locale={persian_fa}
calendarPosition="bottom-right"
/>
شخصی سازی نام ها
import React, { useState } from "react"
import Toolbar from "react-multi-date-picker/plugins/toolbar"
import persian from "react-date-object/calendars/persian"
import persian_fa from "react-date-object/locales/persian_fa"
.
.
.
const [value, setValue] = useState()
.
.
.
<DatePicker
value={value}
onChange={setValue}
plugins={[
<Toolbar
position="bottom"
names={{
today: "گرفتن امروز"
deselect: "حذف"
close: "بسته شدن"
}}
/>,
]}
calendar={persian}
locale={persian_fa}
calendarPosition="bottom-right"
/>