Skip to content

Commit

Permalink
fix: update date using utc timezone instead of local (#1043)
Browse files Browse the repository at this point in the history
* fix: update date using utc timezone instead of local

* fix: lint error
  • Loading branch information
KristinAoki authored May 24, 2024
1 parent 732b7ed commit 435af2c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/course-updates/hooks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 435af2c

Please sign in to comment.