diff --git a/apps/ios/Shared/Views/Badges/BadgesPayView.swift b/apps/ios/Shared/Views/Badges/BadgesPayView.swift index 362d7564a6..b32c14485f 100644 --- a/apps/ios/Shared/Views/Badges/BadgesPayView.swift +++ b/apps/ios/Shared/Views/Badges/BadgesPayView.swift @@ -127,7 +127,9 @@ struct BadgesPayView: View { private var billingFooter: LocalizedStringKey { // TODO [badges] source the actual date from the purchase state machine when wired. - let date = "July 22, 2026" + var comps = DateComponents(); comps.year = 2026; comps.month = 7; comps.day = 22 + let stubDate = Calendar.current.date(from: comps) ?? Date() + let date = DateFormatter.localizedString(from: stubDate, dateStyle: .long, timeStyle: .none) switch selectedPeriod { case .subscribe: return "Renews on \(date). Cancel anytime." case .oneMonth: return "Ends on \(date)." diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesPayView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesPayView.kt index c50c0c4aa9..72d519048e 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesPayView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/badges/BadgesPayView.kt @@ -95,7 +95,7 @@ fun BadgesPayView(level: BadgeLevel) { modifier = Modifier.padding(top = 7.5.dp, bottom = 7.5.dp).clip(CircleShape) ) { Text( - stringResource(billingFooter(selectedPeriod)).format("July 22, 2026"), + stringResource(billingFooter(selectedPeriod)).format(stubBillingDate()), Modifier.padding(vertical = 5.dp), style = MaterialTheme.typography.body2, color = MaterialTheme.colors.secondary, @@ -147,8 +147,14 @@ private fun PayButton(level: BadgeLevel, selectedPeriod: BadgePeriod) { ) } -// TODO [badges] source the actual renewal/end date from the purchase state machine when wired. private fun billingFooter(period: BadgePeriod): StringResource = when (period) { BadgePeriod.Subscribe -> MR.strings.badges_billing_footer_subscribe BadgePeriod.OneMonth -> MR.strings.badges_billing_footer_one_month } + +// TODO [badges] source the actual date from the purchase state machine when wired. +private fun stubBillingDate(): String { + val date = java.time.LocalDate.of(2026, 7, 22) + val formatter = java.time.format.DateTimeFormatter.ofLocalizedDate(java.time.format.FormatStyle.LONG) + return date.format(formatter) +}