diff --git a/core/network/src/main/java/com/wap/wapp/core/network/source/attendancestatus/AttendanceStatusDataSourceImpl.kt b/core/network/src/main/java/com/wap/wapp/core/network/source/attendancestatus/AttendanceStatusDataSourceImpl.kt index 853c50342..30fd28f6a 100644 --- a/core/network/src/main/java/com/wap/wapp/core/network/source/attendancestatus/AttendanceStatusDataSourceImpl.kt +++ b/core/network/src/main/java/com/wap/wapp/core/network/source/attendancestatus/AttendanceStatusDataSourceImpl.kt @@ -7,6 +7,7 @@ import com.wap.wapp.core.network.constant.EVENT_COLLECTION import com.wap.wapp.core.network.model.attendancestatus.AttendanceStatusRequest import com.wap.wapp.core.network.model.attendancestatus.AttendanceStatusResponse import com.wap.wapp.core.network.utils.await +import com.wap.wapp.core.network.utils.getSeoulDateTimeNow import java.time.LocalDateTime import java.time.format.DateTimeFormatter import javax.inject.Inject @@ -33,7 +34,7 @@ class AttendanceStatusDataSourceImpl @Inject constructor( override suspend fun postAttendanceStatus(eventId: String, userId: String): Result = runCatching { val attendanceStatusRequest = - AttendanceStatusRequest(generateNowDateTime().toISOLocalDateTimeString()) + AttendanceStatusRequest(getSeoulDateTimeNow().toISOLocalDateTimeString()) firebaseFirestore.collection(ATTENDANCE_STATUS_COLLECTION) .document(userId) diff --git a/core/network/src/main/java/com/wap/wapp/core/network/source/event/EventDataSourceImpl.kt b/core/network/src/main/java/com/wap/wapp/core/network/source/event/EventDataSourceImpl.kt index 5cafa09c9..24f5ec505 100644 --- a/core/network/src/main/java/com/wap/wapp/core/network/source/event/EventDataSourceImpl.kt +++ b/core/network/src/main/java/com/wap/wapp/core/network/source/event/EventDataSourceImpl.kt @@ -6,6 +6,7 @@ import com.wap.wapp.core.network.constant.EVENT_COLLECTION import com.wap.wapp.core.network.model.event.EventRequest import com.wap.wapp.core.network.model.event.EventResponse import com.wap.wapp.core.network.utils.await +import com.wap.wapp.core.network.utils.getSeoulDateTimeNow import java.time.LocalDate import java.time.LocalDateTime import java.time.LocalTime @@ -37,7 +38,7 @@ class EventDataSourceImpl @Inject constructor( // 선택된 날짜 1일 00시 00분 00초 val startDateTime = date.atStartOfDay().toISOLocalDateTimeString() - val currentDateTime = generateNowDateTime().toISOLocalDateTimeString() + val currentDateTime = getSeoulDateTimeNow().toISOLocalDateTimeString() val task = firebaseFirestore.collection(EVENT_COLLECTION) .whereGreaterThanOrEqualTo("startDateTime", startDateTime) .whereLessThanOrEqualTo("startDateTime", currentDateTime) diff --git a/core/network/src/main/java/com/wap/wapp/core/network/utils/LocalDateTime.kt b/core/network/src/main/java/com/wap/wapp/core/network/utils/LocalDateTime.kt index 3f1a08aca..48e035e97 100644 --- a/core/network/src/main/java/com/wap/wapp/core/network/utils/LocalDateTime.kt +++ b/core/network/src/main/java/com/wap/wapp/core/network/utils/LocalDateTime.kt @@ -1,9 +1,12 @@ package com.wap.wapp.core.network.utils import java.time.LocalDateTime +import java.time.ZoneId import java.time.format.DateTimeFormatter internal fun String.toISOLocalDateTime(): LocalDateTime = LocalDateTime.parse( this, DateTimeFormatter.ISO_LOCAL_DATE_TIME, ) + +internal fun getSeoulDateTimeNow() = LocalDateTime.now(ZoneId.of("Asia/Seoul"))