diff --git a/slash/react/src/Form/Date/Date.tsx b/slash/react/src/Form/Date/Date.tsx index 34332898f..63de105f8 100644 --- a/slash/react/src/Form/Date/Date.tsx +++ b/slash/react/src/Form/Date/Date.tsx @@ -9,9 +9,10 @@ type Props = Omit, "value"> & { }; const formatDateValue = (dateValue: Date) => { - const monthFormatted = `0${dateValue.getMonth() + 1}`.slice(-2); - const dayFormatted = `0${dateValue.getDate()}`.slice(-2); - return `${dateValue.getFullYear()}-${monthFormatted}-${dayFormatted}`; + const formattedDateValue = new globalThis.Date(dateValue); + const monthFormatted = `0${formattedDateValue.getMonth() + 1}`.slice(-2); + const dayFormatted = `0${formattedDateValue.getDate()}`.slice(-2); + return `${formattedDateValue.getFullYear()}-${monthFormatted}-${dayFormatted}`; }; const Date = forwardRef(