Skip to content

Commit 65dda5e

Browse files
authored
Merge pull request #133 from boostcamp-2020/dev
merge dev branch for production
2 parents a984b15 + 48fad8d commit 65dda5e

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

β€Žclient/src/components/presentational/analysis/AnalysisForm.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ const initCheckbox = (items, itemType, location, mode) => {
140140
}
141141

142142
const { type, name } = location.state;
143-
const initState = flipToFalse(items);
143+
const initState = items.reduce((acc, cur) => {
144+
acc[cur] = false;
145+
return acc;
146+
}, {});
144147

145148
if (itemType !== type) {
146149
return initState;
@@ -149,7 +152,6 @@ const initCheckbox = (items, itemType, location, mode) => {
149152
if (name && Object.hasOwnProperty.call(initState, name)) {
150153
return { ...initState, [name]: true };
151154
}
152-
153155
return initState;
154156
};
155157

β€Žclient/util/transaction.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
export const getCurrentDateTransactions = (date = [], transactions = []) => {
1+
export const getCurrentDateTransactions = (date, transactions) => {
22
if (!date || !transactions) {
33
return [];
44
}
5-
65
return transactions.filter((transaction) => {
76
if (transaction.date) {
8-
const [year, month] = transaction?.date.split('-');
7+
const transactionDate = new Date(transaction.date);
8+
const month = transactionDate.getMonth() + 1;
9+
const year = transactionDate.getFullYear();
910
return year == date?.year && month == date?.month;
1011
}
1112
return;

0 commit comments

Comments
Β (0)