Skip to content

Commit

Permalink
Merge pull request #355 from boostcamp-2020/develop
Browse files Browse the repository at this point in the history
[FE] Fix: IOS TransactionHeader undefined나오는 문제 수정
  • Loading branch information
pkiop authored Dec 18, 2020
2 parents 2aaf1d2 + 294f9bc commit 1fd0c81
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
15 changes: 9 additions & 6 deletions fe/src/pages/MainPage/TransactionDateList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from 'stores/Transaction/transactionStoreUtils';
import { observer } from 'mobx-react-lite';
import * as types from 'types';
import dateUtil from 'utils/date';

const TransactionDateList = ({
list,
Expand All @@ -29,12 +30,14 @@ const TransactionDateList = ({
transactionList,
);
return (
<TransactionList
key={date}
date={new Date(date)}
onClick={onClick}
transactionList={formattedTransactionList}
/>
<>
<TransactionList
key={date}
date={new Date(dateUtil.addZero(date))}
onClick={onClick}
transactionList={formattedTransactionList}
/>
</>
);
};

Expand Down
6 changes: 6 additions & 0 deletions fe/src/utils/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,10 @@ export default {
absoluteTargetDate <= absoluteEndDate
);
},
addZero(str: string) {
const [year, month, date] = str.split('-');
return `${year}-${month.length === 1 ? `0${month}` : month}-${
date.length === 1 ? `0${date}` : date
}`;
},
};

0 comments on commit 1fd0c81

Please sign in to comment.