Skip to content

Commit

Permalink
[REFACTOR/#45] convertTo24HourFormat 함수 리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
DongChyeon committed Jan 19, 2025
1 parent ff07fb2 commit c824f11
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,10 @@ class AlarmAddEditViewModel @Inject constructor() : BaseViewModel<AlarmAddEditCo
}
}

private fun convertTo24HourFormat(amPm: String, hour: Int): Int {
return if (amPm == "오후" && hour != 12) {
hour + 12
} else if (amPm == "오전" && hour == 12) {
0
} else {
hour
}
private fun convertTo24HourFormat(amPm: String, hour: Int): Int = when {
amPm == "오후" && hour != 12 -> hour + 12
amPm == "오전" && hour == 12 -> 0
else -> hour
}

private fun calculateNextAlarmDateTime(
Expand Down

0 comments on commit c824f11

Please sign in to comment.