diff --git a/src/course-updates/hooks.jsx b/src/course-updates/hooks.jsx index 0482af6f20..b725fe5fe2 100644 --- a/src/course-updates/hooks.jsx +++ b/src/course-updates/hooks.jsx @@ -4,6 +4,7 @@ import { useEffect, useState } from 'react'; import { useToggle } from '@openedx/paragon'; import { COMMA_SEPARATED_DATE_FORMAT } from '../constants'; +import { convertToDateFromString } from '../utils'; import { getCourseHandouts, getCourseUpdates } from './data/selectors'; import { REQUEST_TYPES } from './constants'; import { @@ -55,9 +56,10 @@ const useCourseUpdates = ({ courseId }) => { }; const handleUpdatesSubmit = (data) => { + const dateWithoutTimezone = convertToDateFromString(data.date); const dataToSend = { ...data, - date: moment(data.date).format(COMMA_SEPARATED_DATE_FORMAT), + date: moment(dateWithoutTimezone).format(COMMA_SEPARATED_DATE_FORMAT), }; const { id, date, content } = dataToSend;