From eeebfe9b07713977f94a24b1b7813d51fc0930db Mon Sep 17 00:00:00 2001 From: Shpileva Yuliya Date: Thu, 1 Dec 2022 10:26:52 +0400 Subject: [PATCH] fix(react-scheduler): fix types (#3605) --- .../src/templates/all-day-panel/cell.jsx | 4 ++-- .../src/templates/appointment-form/basic/layout.jsx | 4 ++-- .../src/templates/appointment-form/recurrence/layout.jsx | 4 ++-- .../templates/appointment-form/recurrence/layouts/daily.jsx | 4 ++-- .../templates/appointment-form/recurrence/layouts/monthly.jsx | 4 ++-- .../templates/appointment-form/recurrence/layouts/weekly.jsx | 4 ++-- .../templates/appointment-form/recurrence/layouts/yearly.jsx | 4 ++-- .../recurrence/radio-group/end-repeat-editor.jsx | 4 ++-- .../recurrence/radio-group/monthly-editor.jsx | 4 ++-- .../appointment-form/recurrence/radio-group/radio-group.jsx | 4 ++-- .../appointment-form/recurrence/radio-group/yealy-editor.jsx | 4 ++-- .../src/templates/confirmation-dialog/layout.jsx | 4 ++-- .../src/templates/views/horizontal/day-scale/cell.jsx | 4 ++-- .../src/templates/views/horizontal/time-table/cell.jsx | 4 ++-- .../src/templates/views/vertical/day-scale/cell.jsx | 4 ++-- .../src/templates/views/vertical/time-scale/tick-cell.jsx | 4 ++-- .../src/templates/views/vertical/time-table/cell.jsx | 4 ++-- 17 files changed, 34 insertions(+), 34 deletions(-) diff --git a/packages/dx-react-scheduler-material-ui/src/templates/all-day-panel/cell.jsx b/packages/dx-react-scheduler-material-ui/src/templates/all-day-panel/cell.jsx index c428bc0b35..8525b1bb05 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/all-day-panel/cell.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/all-day-panel/cell.jsx @@ -66,8 +66,8 @@ export const Cell = ({ ); Cell.propTypes = { - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), children: PropTypes.node, className: PropTypes.string, hasRightBorder: PropTypes.bool, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/basic/layout.jsx b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/basic/layout.jsx index d4b9494c1c..ea1c3e72e9 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/basic/layout.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/basic/layout.jsx @@ -245,8 +245,8 @@ Layout.propTypes = { onFieldChange: PropTypes.func, appointmentData: PropTypes.shape({ title: PropTypes.string, - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), rRule: PropTypes.string, notes: PropTypes.string, additionalInformation: PropTypes.string, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layout.jsx b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layout.jsx index befe1ed7ff..9c2923c077 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layout.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layout.jsx @@ -221,8 +221,8 @@ Layout.propTypes = { readOnly: PropTypes.bool, appointmentData: PropTypes.shape({ title: PropTypes.string, - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), rRule: PropTypes.string, notes: PropTypes.string, additionalInformation: PropTypes.string, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/daily.jsx b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/daily.jsx index 287a47a237..a3da9bf2a1 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/daily.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/daily.jsx @@ -53,8 +53,8 @@ Daily.propTypes = { ]).isRequired, appointmentData: PropTypes.shape({ title: PropTypes.string, - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), rRule: PropTypes.string, notes: PropTypes.string, additionalInformation: PropTypes.string, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/monthly.jsx b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/monthly.jsx index 2aa4c1de15..0a27fa65f3 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/monthly.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/monthly.jsx @@ -83,8 +83,8 @@ Monthly.propTypes = { ]).isRequired, appointmentData: PropTypes.shape({ title: PropTypes.string, - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), rRule: PropTypes.string, notes: PropTypes.string, additionalInformation: PropTypes.string, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/weekly.jsx b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/weekly.jsx index 395ce86ceb..7c81c9491f 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/weekly.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/weekly.jsx @@ -74,8 +74,8 @@ Weekly.propTypes = { ]).isRequired, appointmentData: PropTypes.shape({ title: PropTypes.string, - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), rRule: PropTypes.string, notes: PropTypes.string, additionalInformation: PropTypes.string, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/yearly.jsx b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/yearly.jsx index 7c3aa17cb9..4be25ccf15 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/yearly.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/layouts/yearly.jsx @@ -83,8 +83,8 @@ Yearly.propTypes = { ]).isRequired, appointmentData: PropTypes.shape({ title: PropTypes.string, - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), rRule: PropTypes.string, notes: PropTypes.string, additionalInformation: PropTypes.string, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/end-repeat-editor.jsx b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/end-repeat-editor.jsx index cc9d4fb7d9..4b506cf02c 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/end-repeat-editor.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/end-repeat-editor.jsx @@ -203,8 +203,8 @@ EndRepeatEditor.propTypes = { onFieldChange: PropTypes.func, appointmentData: PropTypes.shape({ title: PropTypes.string, - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), rRule: PropTypes.string, notes: PropTypes.string, additionalInformation: PropTypes.string, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/monthly-editor.jsx b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/monthly-editor.jsx index 97815fb331..6f78e9f1ce 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/monthly-editor.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/monthly-editor.jsx @@ -224,8 +224,8 @@ MonthlyEditor.propTypes = { selectComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired, appointmentData: PropTypes.shape({ title: PropTypes.string, - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), rRule: PropTypes.string, notes: PropTypes.string, additionalInformation: PropTypes.string, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/radio-group.jsx b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/radio-group.jsx index c4b4775b76..53c4817f85 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/radio-group.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/radio-group.jsx @@ -78,8 +78,8 @@ RadioGroup.propTypes = { type: PropTypes.string.isRequired, appointmentData: PropTypes.shape({ title: PropTypes.string, - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), rRule: PropTypes.string, notes: PropTypes.string, additionalInformation: PropTypes.string, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/yealy-editor.jsx b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/yealy-editor.jsx index 3ee393301c..231f26e905 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/yealy-editor.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/appointment-form/recurrence/radio-group/yealy-editor.jsx @@ -154,8 +154,8 @@ YearlyEditor.propTypes = { selectComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired, appointmentData: PropTypes.shape({ title: PropTypes.string, - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), rRule: PropTypes.string, notes: PropTypes.string, additionalInformation: PropTypes.string, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/confirmation-dialog/layout.jsx b/packages/dx-react-scheduler-material-ui/src/templates/confirmation-dialog/layout.jsx index b8b73d7979..adebcf5b79 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/confirmation-dialog/layout.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/confirmation-dialog/layout.jsx @@ -56,8 +56,8 @@ Layout.propTypes = { isDeleting: PropTypes.bool, appointmentData: PropTypes.shape({ title: PropTypes.string, - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), rRule: PropTypes.string, notes: PropTypes.string, additionalInformation: PropTypes.string, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/views/horizontal/day-scale/cell.jsx b/packages/dx-react-scheduler-material-ui/src/templates/views/horizontal/day-scale/cell.jsx index 7f297253c3..ae637dd18e 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/views/horizontal/day-scale/cell.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/views/horizontal/day-scale/cell.jsx @@ -69,8 +69,8 @@ export const Cell = ({ ); Cell.propTypes = { formatDate: PropTypes.func.isRequired, - startDate: PropTypes.instanceOf(Date).isRequired, - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]).isRequired, + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), className: PropTypes.string, today: PropTypes.bool, endOfGroup: PropTypes.bool, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/views/horizontal/time-table/cell.jsx b/packages/dx-react-scheduler-material-ui/src/templates/views/horizontal/time-table/cell.jsx index 61c73610f1..a0d736f31e 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/views/horizontal/time-table/cell.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/views/horizontal/time-table/cell.jsx @@ -137,8 +137,8 @@ const CellBase = React.memo(({ CellBase.propTypes = { formatDate: PropTypes.func.isRequired, - startDate: PropTypes.instanceOf(Date).isRequired, - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]).isRequired, + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), className: PropTypes.string, today: PropTypes.bool, otherMonth: PropTypes.bool, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/day-scale/cell.jsx b/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/day-scale/cell.jsx index 532b1223e3..08e4887c44 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/day-scale/cell.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/day-scale/cell.jsx @@ -113,8 +113,8 @@ export const Cell = ({ Cell.propTypes = { formatDate: PropTypes.func.isRequired, - startDate: PropTypes.instanceOf(Date).isRequired, - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]).isRequired, + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), className: PropTypes.string, today: PropTypes.bool, endOfGroup: PropTypes.bool, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/time-scale/tick-cell.jsx b/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/time-scale/tick-cell.jsx index 2cefd9ff21..2f14871824 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/time-scale/tick-cell.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/time-scale/tick-cell.jsx @@ -53,8 +53,8 @@ export const TickCell = ({ ); TickCell.propTypes = { - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), endOfGroup: PropTypes.bool, groupingInfo: PropTypes.arrayOf(PropTypes.object), isAllDay: PropTypes.bool, diff --git a/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/time-table/cell.jsx b/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/time-table/cell.jsx index aa671a3fd1..afae5404e8 100644 --- a/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/time-table/cell.jsx +++ b/packages/dx-react-scheduler-material-ui/src/templates/views/vertical/time-table/cell.jsx @@ -120,8 +120,8 @@ export const Cell = ({ }; Cell.propTypes = { - startDate: PropTypes.instanceOf(Date), - endDate: PropTypes.instanceOf(Date), + startDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + endDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), children: PropTypes.node, className: PropTypes.string, currentTimeIndicatorPosition: PropTypes.string,