From fc9e26c64338baac24e3a935b5e3328088b2a43b Mon Sep 17 00:00:00 2001 From: Sasha Chabin Date: Tue, 25 Jun 2024 20:09:31 +0500 Subject: [PATCH] docs(DatePicker,Calendar): remove period props (#3452) --- .../react-ui/components/Calendar/Calendar.tsx | 12 --------- .../components/DatePicker/DatePicker.md | 27 +++++++------------ 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/packages/react-ui/components/Calendar/Calendar.tsx b/packages/react-ui/components/Calendar/Calendar.tsx index 402479b09e5..4b50dab03be 100644 --- a/packages/react-ui/components/Calendar/Calendar.tsx +++ b/packages/react-ui/components/Calendar/Calendar.tsx @@ -53,18 +53,6 @@ export interface CalendarProps extends CommonProps { * Дата задаётся в формате `dd.mm.yyyy` */ minDate?: string; - /** - * Задаёт начальную дату периода - * - * Дата задаётся в формате `dd.mm.yyyy` - */ - periodStartDate?: string; - /** - * Задаёт конечную дату периода - * - * Дата задаётся в формате `dd.mm.yyyy` - */ - periodEndDate?: string; /** * Функция для определения праздничных дней * @default (_day, isWeekend) => isWeekend diff --git a/packages/react-ui/components/DatePicker/DatePicker.md b/packages/react-ui/components/DatePicker/DatePicker.md index e00c85e21eb..71d35878c86 100644 --- a/packages/react-ui/components/DatePicker/DatePicker.md +++ b/packages/react-ui/components/DatePicker/DatePicker.md @@ -274,30 +274,23 @@ class DatePickerFormatting extends React.Component { ; ``` -### Период дат -Подбробный пример в [Calendar](#/Components/Calendar) - -```jsx harmony -const [value, setValue] = React.useState('12.05.2022'); - -; -``` - ### Кастомный рендер дня Подбробный пример в [Calendar](#/Components/Calendar) ```jsx harmony +import { CalendarDay } from "@skbkontur/react-ui"; + const [value, setValue] = React.useState('12.05.2022'); -const renderDay = (date, defaultProps, RenderDefault) => { - const isEven = defaultProps.children % 2 === 0; +const renderDay = (props) => { + const [date] = props.date.split('.').map(Number); + const isEven = date % 2 === 0; - return ; + if (isEven) { + return + } + + return };