From 53cb6634ab70e7586d69bb1e7bfe489fab059519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=ED=9D=AC=EC=9A=B0?= <84004687+huiwoo-jo@users.noreply.github.com> Date: Wed, 14 Aug 2024 02:52:42 +0900 Subject: [PATCH] =?UTF-8?q?build=20:=20=ED=95=99=EC=82=AC=EC=9D=BC?= =?UTF-8?q?=EC=A0=95=20datepicker=20=EC=98=B5=EC=85=98=20=EC=B6=9C?= =?UTF-8?q?=EB=A0=A5=20=EB=B0=A9=EC=8B=9D=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../youdongknowme/ui/view/schedule/DatePickerDialog.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/dongyang/android/youdongknowme/ui/view/schedule/DatePickerDialog.kt b/app/src/main/java/com/dongyang/android/youdongknowme/ui/view/schedule/DatePickerDialog.kt index 512dccc3..11c747d2 100644 --- a/app/src/main/java/com/dongyang/android/youdongknowme/ui/view/schedule/DatePickerDialog.kt +++ b/app/src/main/java/com/dongyang/android/youdongknowme/ui/view/schedule/DatePickerDialog.kt @@ -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 @@ -59,6 +61,8 @@ class DatePickerDialog( binding.numberpickerDialogDatepickerYear.setOnValueChangedListener { _, _, newYear -> maxValue = if (newYear == currentYear + 1) 2 else 12 } + + displayedValues=((minValue..maxValue).map{"$it 월"}.toTypedArray()) } // 초기 설정