Skip to content

Commit

Permalink
fix date format
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmochu committed Apr 15, 2019
1 parent 6cebd87 commit 3b86943
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/ApproveBudget/components/ApproveBudgetComponent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import dateFns from 'date-fns';
import { format } from 'date-fns';
import PropTypes from 'prop-types';

import ActionsComponent from '../../VerifyActivities/components/ActionsComponent';
Expand All @@ -25,7 +25,7 @@ const ApproveBudgetComponent = ({ activities }) => {
return (
<tr key={id} className='myactivities__table__row'>
<td>{user.name}</td>
<td>{dateFns.format(createdAt, 'MMM DD YYYY')}</td>
<td>{format(new Date(createdAt), 'MMM dd yyyy')}</td>
<td>{`${pointsToDollarConverter(value)} USD`}</td>
<td>
<TruncateDescriptionContainer description={name} wordCount={80} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { shallow } from 'enzyme';
import dateFns from 'date-fns';
import { format } from 'date-fns';

import ApproveBudgetComponent from '../ApproveBudgetComponent';

Expand All @@ -26,7 +26,7 @@ describe('<ApproveBudgetComponent />', () => {

it('should have date of redemption in TableComponent', () => {
const shallowWrapper = setUpWrapper({ activities: redemptions });
const date = dateFns.format(redemption.createdAt, 'MMM DD YYYY');
const date = format(new Date(redemption.createdAt), 'MMM dd yyyy');
expect(shallowWrapper.find('TableComponent').html()).toContain(`${date}`);
});

Expand Down

0 comments on commit 3b86943

Please sign in to comment.