Skip to content

Commit

Permalink
🎨 [#29] Resolve PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-Jun-Young committed Jan 23, 2024
1 parent 30bf11f commit 0c6191d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class ProgDatePickerState(
var month by mutableStateOf(initialDate.toLocalDateTime(TimeZone.currentSystemDefault()).monthNumber.toString())
var day by mutableStateOf(initialDate.toLocalDateTime(TimeZone.currentSystemDefault()).dayOfMonth.toString())

val yearList = (minDate.toLocalDateTime(TimeZone.currentSystemDefault()).year..maxDate.toLocalDateTime(TimeZone.currentSystemDefault()).year).toList().map { it.toString() }
val monthList = (1..12).toList().map{ it.toString()}
val dayList = (1..31).toList().map{ it.toString()} // TODO : Change DateList when month change.
val yearList = (minDate.toLocalDateTime(TimeZone.currentSystemDefault()).year..maxDate.toLocalDateTime(TimeZone.currentSystemDefault()).year).map { it.toString() }
val monthList = (1..12).map{ it.toString()}
val dayList = (1..31).map{ it.toString()} // TODO : Change DateList when month change.

companion object {
fun Saver(): Saver<ProgDatePickerState, *> = Saver(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ fun PreviewProgTimePicker() {
shape = RoundedCornerShape(1)
) {
ProgTimePicker(
timePickerState = ProgTimePickerState(1, 30, is24Hour = false, timeGap = TimeGap.ONE_THIRD),
onTimeChanged = { a, b, c -> }
timePickerState = ProgTimePickerState(1, 20, is24Hour = false, timeGap = TimeGap.FIVE),
onTimeChanged = { hour, minute, meridiem -> }
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ class ProgTimePickerState(

val hourList: List<String> =
if (is24Hour) (0..23).map { it.toString() } else (1..12).map { it.toString() }
@OptIn(ExperimentalStdlibApi::class)
val minuteList: List<String>
get() = (0..59).filter { it.mod(timeGap.interval) == 0 }.map { it.toString() }
get() = (0..<60).filter { it.mod(timeGap.interval) == 0 }.map { it.toString() }

val meridiemList: List<String> = listOf("AM", "PM")

Expand Down

0 comments on commit 0c6191d

Please sign in to comment.