Skip to content

Commit 1fd0c81

Browse files
authored
Merge pull request #355 from boostcamp-2020/develop
[FE] Fix: IOS TransactionHeader undefined나오는 문제 수정
2 parents 2aaf1d2 + 294f9bc commit 1fd0c81

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

fe/src/pages/MainPage/TransactionDateList.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
} from 'stores/Transaction/transactionStoreUtils';
88
import { observer } from 'mobx-react-lite';
99
import * as types from 'types';
10+
import dateUtil from 'utils/date';
1011

1112
const TransactionDateList = ({
1213
list,
@@ -29,12 +30,14 @@ const TransactionDateList = ({
2930
transactionList,
3031
);
3132
return (
32-
<TransactionList
33-
key={date}
34-
date={new Date(date)}
35-
onClick={onClick}
36-
transactionList={formattedTransactionList}
37-
/>
33+
<>
34+
<TransactionList
35+
key={date}
36+
date={new Date(dateUtil.addZero(date))}
37+
onClick={onClick}
38+
transactionList={formattedTransactionList}
39+
/>
40+
</>
3841
);
3942
};
4043

fe/src/utils/date.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,10 @@ export default {
7373
absoluteTargetDate <= absoluteEndDate
7474
);
7575
},
76+
addZero(str: string) {
77+
const [year, month, date] = str.split('-');
78+
return `${year}-${month.length === 1 ? `0${month}` : month}-${
79+
date.length === 1 ? `0${date}` : date
80+
}`;
81+
},
7682
};

0 commit comments

Comments
 (0)