chore: update date-fns

This commit is contained in:
Oliver Eyton-Williams
2020-10-13 11:29:53 +02:00
committed by Mrugesh Mohapatra
parent 6da9d105e0
commit 35f43e8886
5 changed files with 17 additions and 16 deletions

View File

@@ -3,10 +3,10 @@ import PropTypes from 'prop-types';
import CalendarHeatMap from '@freecodecamp/react-calendar-heatmap';
import { Row } from '@freecodecamp/react-bootstrap';
import ReactTooltip from 'react-tooltip';
import addDays from 'date-fns/add_days';
import addMonths from 'date-fns/add_months';
import startOfDay from 'date-fns/start_of_day';
import isEqual from 'date-fns/is_equal';
import addDays from 'date-fns/addDays';
import addMonths from 'date-fns/addMonths';
import startOfDay from 'date-fns/startOfDay';
import isEqual from 'date-fns/isEqual';
import FullWidthRow from '../../helpers/FullWidthRow';
import Spacer from '../../helpers/Spacer';

View File

@@ -80,7 +80,8 @@ class TimelineInner extends Component {
renderCompletion(completed) {
const { idToNameMap, username } = this.props;
const { id, completedDate } = completed;
const { id } = completed;
const completedDate = new Date(completed.completedDate);
const { challengeTitle, challengePath, certPath } = idToNameMap.get(id);
return (
<tr className='timeline-row' key={id}>
@@ -99,8 +100,8 @@ class TimelineInner extends Component {
)}
</td>
<td className='text-center'>
<time dateTime={format(completedDate, 'YYYY-MM-DDTHH:MM:SSZ')}>
{format(completedDate, 'MMMM D, YYYY')}
<time dateTime={completedDate.toISOString()}>
{format(completedDate, 'MMMM d, y')}
</time>
</td>
</tr>