diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml index 3338c990a4..daa73b45ff 100644 --- a/android/gradle/libs.versions.toml +++ b/android/gradle/libs.versions.toml @@ -87,8 +87,8 @@ juspay-hypersdk = "2.1.33" juspay-hypersdkPlugin = "2.0.4" kotlin = "2.2.0" kotlinx-coroutines = "1.10.2" -kotlinx-serialization = "1.9.0" -kotlinx-datetime = "0.7.0" +kotlinx-serialization = "1.8.1" +kotlinx-datetime = "0.6.0" ksp = "2.2.0-2.0.2" lottie = "6.6.7" masayukiSuda-easingInterpolator = "v1.3.2" diff --git a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/model/data/MonthYear.kt b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/model/data/MonthYear.kt index c36806491d..81e91607b9 100644 --- a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/model/data/MonthYear.kt +++ b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/model/data/MonthYear.kt @@ -9,19 +9,17 @@ package com.navi.moneymanager.billcalendar.domain.model.data import androidx.compose.runtime.Immutable import com.navi.moneymanager.common.model.Month -import kotlin.time.Clock +import kotlinx.datetime.Clock import kotlinx.datetime.LocalDate import kotlinx.datetime.TimeZone -import kotlinx.datetime.number import kotlinx.datetime.toLocalDateTime @Immutable data class MonthYear(val month: Int, val year: Int) { companion object { - @OptIn(kotlin.time.ExperimentalTime::class) fun current(): MonthYear { val now = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()).date - return MonthYear(now.month.number, now.year) + return MonthYear(now.monthNumber, now.year) } } diff --git a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/model/response/BillCalendarResponse.kt b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/model/response/BillCalendarResponse.kt index d214a49dba..0f92ade26f 100644 --- a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/model/response/BillCalendarResponse.kt +++ b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/model/response/BillCalendarResponse.kt @@ -15,7 +15,7 @@ import com.navi.moneymanager.billcalendar.presentation.model.data.BillCalendarIc import com.navi.moneymanager.billcalendar.presentation.utils.util.timestampToLocalDateInIST import com.navi.moneymanager.common.utils.Constants.RUPEE_SYMBOL import com.navi.naviwidgets.utils.formatAmount -import kotlin.time.Clock +import kotlinx.datetime.Clock import kotlinx.datetime.TimeZone import kotlinx.datetime.daysUntil import kotlinx.datetime.toLocalDateTime @@ -49,7 +49,6 @@ data class BillData( } } - @OptIn(kotlin.time.ExperimentalTime::class) fun calculateDaysUntilBillDue(): Int { val dueDate = timestampToLocalDateInIST(billDueDate) val today = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()).date diff --git a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/usecase/BillCalendarGridUseCase.kt b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/usecase/BillCalendarGridUseCase.kt index 51997a1905..d18345bea5 100644 --- a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/usecase/BillCalendarGridUseCase.kt +++ b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/domain/usecase/BillCalendarGridUseCase.kt @@ -17,13 +17,12 @@ import com.navi.moneymanager.billcalendar.presentation.utils.util.timestampToLoc import com.navi.moneymanager.common.dataprovider.data.dashboard.helper.MMConfigResponseHelper import javax.inject.Inject import kotlin.math.abs -import kotlin.time.Clock +import kotlinx.datetime.Clock import kotlinx.datetime.DateTimeUnit import kotlinx.datetime.LocalDate import kotlinx.datetime.TimeZone import kotlinx.datetime.isoDayNumber import kotlinx.datetime.minus -import kotlinx.datetime.number import kotlinx.datetime.plus import kotlinx.datetime.toLocalDateTime @@ -44,7 +43,6 @@ constructor(private val mmConfigHelper: MMConfigResponseHelper) { return calendarGrid } - @OptIn(kotlin.time.ExperimentalTime::class) private fun constructGrid(monthYear: MonthYear, bills: List): List { val monthlyBills = mutableListOf() val today = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()).date @@ -55,7 +53,7 @@ constructor(private val mmConfigHelper: MMConfigResponseHelper) { while (currentDate <= calendarEndDate) { val isEnabled = - currentDate.month.number == monthYear.month && currentDate.year == monthYear.year + currentDate.monthNumber == monthYear.month && currentDate.year == monthYear.year val isToday = currentDate == today val billList = if (isEnabled) { diff --git a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/calendar/EmptyDayCell.kt b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/calendar/EmptyDayCell.kt index 20b514f588..bb3c02819f 100644 --- a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/calendar/EmptyDayCell.kt +++ b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/calendar/EmptyDayCell.kt @@ -55,7 +55,7 @@ fun EmptyDayCell( contentAlignment = Alignment.Center, ) { ElexText( - text = date.day.toString(), + text = date.dayOfMonth.toString(), color = textColor, fontSize = 14.sp, fontWeight = fontWeight, diff --git a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/calendar/MultiBillDayCell.kt b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/calendar/MultiBillDayCell.kt index 3ff69bd771..43f11a1bb5 100644 --- a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/calendar/MultiBillDayCell.kt +++ b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/calendar/MultiBillDayCell.kt @@ -37,7 +37,7 @@ fun MultiBillDayCell( Box(modifier = modifier) { CellBackground(isToday = isToday, onClick = onClick) { ElexText( - text = date.day.toString(), + text = date.dayOfMonth.toString(), color = elexColors.base.text.gray.subtle, fontSize = 14.sp, fontWeight = FontWeightEnum.NAVI_BODY_DEMI_BOLD, diff --git a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/details/DateHeading.kt b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/details/DateHeading.kt index d707e79051..ebd9f3ea57 100644 --- a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/details/DateHeading.kt +++ b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/ui/details/DateHeading.kt @@ -79,7 +79,7 @@ fun DateHeading( buildString { append(date.month.name.lowercase().replaceFirstChar { it.uppercaseChar() }) append(SPACE) - append(date.day) + append(date.dayOfMonth) } } diff --git a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/utils/extensions/BillCalendarExtensions.kt b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/utils/extensions/BillCalendarExtensions.kt index bdd8c420f6..597c0be1a6 100644 --- a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/utils/extensions/BillCalendarExtensions.kt +++ b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/utils/extensions/BillCalendarExtensions.kt @@ -25,7 +25,6 @@ import com.navi.moneymanager.common.illustration.repository.ImageRepository.Comp import com.navi.moneymanager.common.model.Month import com.navi.moneymanager.common.utils.MonthConstants.monthNames import kotlinx.datetime.LocalDate -import kotlinx.datetime.number fun MonthYear.toMonthString(): String = buildString { append(Month.fromInt(this@toMonthString.month).fullName) @@ -112,5 +111,5 @@ fun MonthYear.toFormattedMonthYear(): String { } fun LocalDate.toMonthYear(): MonthYear { - return MonthYear(month.number, year) + return MonthYear(monthNumber, year) } diff --git a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/utils/util/BillCalendarUtil.kt b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/utils/util/BillCalendarUtil.kt index 094d508ff6..0118d47da0 100644 --- a/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/utils/util/BillCalendarUtil.kt +++ b/android/navi-money-manager/src/main/kotlin/com/navi/moneymanager/billcalendar/presentation/utils/util/BillCalendarUtil.kt @@ -21,8 +21,8 @@ import com.navi.moneymanager.R import com.navi.moneymanager.billcalendar.domain.model.data.MonthYear import com.navi.moneymanager.billcalendar.presentation.utils.constants.BillCalendarConstants import com.navi.moneymanager.billcalendar.presentation.utils.extensions.toMonthYear -import kotlin.time.Clock -import kotlin.time.Instant +import kotlinx.datetime.Clock +import kotlinx.datetime.Instant import kotlinx.datetime.LocalDate import kotlinx.datetime.TimeZone import kotlinx.datetime.daysUntil @@ -32,7 +32,6 @@ fun toJson(data: T, gsonDeserializer: Gson): String { return gsonDeserializer.toJson(data) } -@OptIn(kotlin.time.ExperimentalTime::class) fun getDueDateText(date: LocalDate, context: Context): String { val currentDate = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()).date val numberOfDays = currentDate.daysUntil(date) @@ -44,7 +43,6 @@ fun getDueDateText(date: LocalDate, context: Context): String { } } -@OptIn(kotlin.time.ExperimentalTime::class) @Composable fun getDueDateColor(date: LocalDate): Color { val currentDate = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()).date @@ -61,7 +59,7 @@ fun getMonthPrefix(date: LocalDate): String { } fun formatDateIntoPrefixMonthNames(date: LocalDate): String { - val day = date.day + val day = date.dayOfMonth val suffix = getDateSuffix(day) val month = getMonthPrefix(date) return buildString { @@ -72,7 +70,6 @@ fun formatDateIntoPrefixMonthNames(date: LocalDate): String { } } -@OptIn(kotlin.time.ExperimentalTime::class) fun timestampToLocalDateInIST(timestamp: String?): LocalDate { if (timestamp.isNullOrEmpty()) { return LocalDate(1970, 1, 1)