Skip to content

Commit ffef5b1

Browse files
committed
FIX: 루틴 작성 화면의 Date클래스 생성시 LocalDate를 한번만 호출하도록 수정
1 parent 447e198 commit ffef5b1

File tree

1 file changed

+8
-5
lines changed
  • presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model

1 file changed

+8
-5
lines changed

presentation/src/main/java/com/threegap/bitnagil/presentation/writeroutine/model/Date.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ data class Date(
1111
val day: Int,
1212
) : Parcelable {
1313
companion object {
14-
fun now() = Date(
15-
year = LocalDate.now().year,
16-
month = LocalDate.now().monthValue,
17-
day = LocalDate.now().dayOfMonth,
18-
)
14+
fun now(): Date {
15+
val currentDate = LocalDate.now()
16+
return Date(
17+
year = currentDate.year,
18+
month = currentDate.monthValue,
19+
day = currentDate.dayOfMonth,
20+
)
21+
}
1922

2023
fun min(d1: Date, d2: Date): Date {
2124
if (d1.year < d2.year) return d1

0 commit comments

Comments
 (0)