Fix budget display and button
- Fix the budget display issue where monthly budgets were showing four amounts instead of one. - Resolve the functionality of the "Edit Budget" button.
This commit is contained in:
@@ -22,19 +22,23 @@ export const calculateUpdatedBudgetData = (
|
||||
if (type === 'monthly') {
|
||||
// 월간 예산이 직접 입력된 경우
|
||||
monthlyAmount = amount;
|
||||
// 월 30일 기준 (실제 사용 시 값 확인)
|
||||
// 월 30일 기준
|
||||
dailyAmount = Math.round(monthlyAmount / 30);
|
||||
// 월 4.3주 기준 (실제 사용 시 값 확인)
|
||||
// 월 4.3주 기준 (30일 / 7일)
|
||||
weeklyAmount = Math.round(monthlyAmount / 4.3);
|
||||
} else if (type === 'weekly') {
|
||||
// 주간 예산이 직접 입력된 경우
|
||||
weeklyAmount = amount;
|
||||
monthlyAmount = Math.round(weeklyAmount * 4.3);
|
||||
// 월 4.3주 기준 (30일 / 7일)
|
||||
monthlyAmount = Math.round(weeklyAmount * 4.3);
|
||||
// 주 7일 기준
|
||||
dailyAmount = Math.round(weeklyAmount / 7);
|
||||
} else { // 'daily'
|
||||
// 일일 예산이 직접 입력된 경우
|
||||
dailyAmount = amount;
|
||||
// 주 7일 기준
|
||||
weeklyAmount = Math.round(dailyAmount * 7);
|
||||
// 월 30일 기준
|
||||
monthlyAmount = Math.round(dailyAmount * 30);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user