diff --git a/packages/ui/src/ui-component/dialog/ViewMessagesDialog.jsx b/packages/ui/src/ui-component/dialog/ViewMessagesDialog.jsx index dc0dd42a1..d85a41ac2 100644 --- a/packages/ui/src/ui-component/dialog/ViewMessagesDialog.jsx +++ b/packages/ui/src/ui-component/dialog/ViewMessagesDialog.jsx @@ -156,7 +156,7 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => { const [hardDeleteDialogProps, setHardDeleteDialogProps] = useState({}) const [chatTypeFilter, setChatTypeFilter] = useState([]) const [feedbackTypeFilter, setFeedbackTypeFilter] = useState([]) - const [startDate, setStartDate] = useState(new Date().setMonth(new Date().getMonth() - 1)) + const [startDate, setStartDate] = useState(new Date(new Date().setMonth(new Date().getMonth() - 1))) const [endDate, setEndDate] = useState(new Date()) const [leadEmail, setLeadEmail] = useState('') @@ -701,7 +701,7 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => { setFeedbackTypeFilter([]) setSelectedMessageIndex(0) setSelectedChatId('') - setStartDate(new Date().setMonth(new Date().getMonth() - 1)) + setStartDate(new Date(new Date().setMonth(new Date().getMonth() - 1))) setEndDate(new Date()) setStats([]) setLeadEmail('') diff --git a/packages/ui/src/views/vectorstore/UpsertHistoryDialog.jsx b/packages/ui/src/views/vectorstore/UpsertHistoryDialog.jsx index b2cf03c9d..62f86b562 100644 --- a/packages/ui/src/views/vectorstore/UpsertHistoryDialog.jsx +++ b/packages/ui/src/views/vectorstore/UpsertHistoryDialog.jsx @@ -197,7 +197,7 @@ const UpsertHistoryDialog = ({ show, dialogProps, onCancel }) => { const closeSnackbar = (...args) => dispatch(closeSnackbarAction(...args)) const [chatflowUpsertHistory, setChatflowUpsertHistory] = useState([]) - const [startDate, setStartDate] = useState(new Date().setMonth(new Date().getMonth() - 1)) + const [startDate, setStartDate] = useState(new Date(new Date().setMonth(new Date().getMonth() - 1))) const [endDate, setEndDate] = useState(new Date()) const [selected, setSelected] = useState([]) @@ -297,7 +297,7 @@ const UpsertHistoryDialog = ({ show, dialogProps, onCancel }) => { return () => { setChatflowUpsertHistory([]) - setStartDate(new Date().setMonth(new Date().getMonth() - 1)) + setStartDate(new Date(new Date().setMonth(new Date().getMonth() - 1))) setEndDate(new Date()) }