From 98bdf2a0f187a34823503e0aac2d77dda166d95e Mon Sep 17 00:00:00 2001 From: mkhutornyi Date: Wed, 13 Dec 2023 02:18:29 -0500 Subject: [PATCH] fix unit test --- src/components/DatePicker/CalendarPicker/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DatePicker/CalendarPicker/index.js b/src/components/DatePicker/CalendarPicker/index.js index 7a558bd92990..078d0dc8fa23 100644 --- a/src/components/DatePicker/CalendarPicker/index.js +++ b/src/components/DatePicker/CalendarPicker/index.js @@ -50,7 +50,7 @@ class CalendarPicker extends React.PureComponent { if (props.minDate >= props.maxDate) { throw new Error('Minimum date cannot be greater than the maximum date.'); } - let currentDateView = parseISO(props.value); + let currentDateView = typeof props.value === 'string' ? parseISO(props.value) : new Date(props.value); if (props.maxDate < currentDateView) { currentDateView = props.maxDate; } else if (props.minDate > currentDateView) {