Skip to content

Commit

Permalink
build : 학사일정 datepicker 옵션 출력 방식 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
huiwoo-jo committed Sep 20, 2024
1 parent 3df50b7 commit 53cb663
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ class DatePickerDialog(
binding.numberpickerDialogDatepickerMonth.descendantFocusability =
NumberPicker.FOCUS_BLOCK_DESCENDANTS

// 연도 및 월의 최소/최대값 설정
// 연도 최소/최대값 설정 및 출력 방식 설정
with(binding.numberpickerDialogDatepickerYear) {
minValue = currentYear - 1
maxValue = currentYear + 1
displayedValues=((minValue..maxValue).map{"$it"}.toTypedArray())
}

// 월 최소/최대값 설정 및 출력 방식 설정
with(binding.numberpickerDialogDatepickerMonth) {
minValue = 1
maxValue = if (year == currentYear + 1) 2 else 12
Expand All @@ -59,6 +61,8 @@ class DatePickerDialog(
binding.numberpickerDialogDatepickerYear.setOnValueChangedListener { _, _, newYear ->
maxValue = if (newYear == currentYear + 1) 2 else 12
}

displayedValues=((minValue..maxValue).map{"$it"}.toTypedArray())
}

// 초기 설정
Expand Down

0 comments on commit 53cb663

Please sign in to comment.