말일 기준으로 바꿈,,,,,,,ㅠㅠㅠㅠㅠ

This commit is contained in:
주수현
2025-07-23 17:00:37 +09:00
parent bbd520156b
commit 8954357898
3 changed files with 14 additions and 7 deletions

View File

@@ -83,8 +83,11 @@ class GetBankInputUIController {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter);
LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
LocalDate minMonth = yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
// TODO 이걸로 수정해야됨
// LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
// LocalDate minMonth = yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth();
LocalDate minMonth = yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth();
LocalDate today = LocalDate.now();
boolean editable = !today.isAfter(maxMonth);
boolean preEditable = !today.isBefore(minMonth);

View File

@@ -82,8 +82,12 @@ class GetBankOutputUIController {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter);
LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
LocalDate minMonth = yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
// TODO 이걸로 수정해야됨
// LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
// LocalDate minMonth = yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth();
LocalDate minMonth = yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth();
LocalDate today = LocalDate.now();
boolean editable = !today.isAfter(maxMonth);

View File

@@ -118,11 +118,11 @@ class CreateMonthlyUIController {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter);
//LocalDate maxMonth = yearMonth.plusMonths(1).atDay(15);
LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
log.info("####################maxMonth={}",maxMonth);
// TODO 이걸로 돌려야됨
//LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth();
LocalDate today = LocalDate.now();
boolean editable = !today.isAfter(maxMonth);
log.info("####################editable={}",editable);
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
model.addAttribute("currentMonthlyInfo", currentMonthlyInfo);