Closed Yixuan-Wang closed 6 months ago
After consulting ChatGPT, I think the fix it provided should be correct. The epoch returned from the DatePicker is based on UTC, not the device's local timezone? You are in UTC+0 so this bug cannot be reproduced.
val instant = Instant.ofEpochMilli(date)
val localDate = instant.atZone(ZoneOffset.UTC).toLocalDate()
// Format the date as needed
val formattedDate = localDate.format(DateTimeFormatter.ISO_LOCAL_DATE)
updateComplicationData {
it.copy(endDate = formattedDate)
}
Fixed in countdown v1.0.1, ChatGPT was right for once in that the timezone is indeed meant to be in UTC
Select the Plugin you are reporting for
Countdown
Description
When you select a day in the
Countdown to
option, the date always shifts 1 day backwards. If you open the date picker, do nothing and press "Ok", the date will continue to shift 1 day back.Currently I'm in UTC-6 timezone, which might be relevant to the bug.
I think the problem should be around here during Instant conversion: https://github.com/KieronQuinn/SmartspacerPlugins/blob/6983c3859c318fcee585c50757c02e70abb39d25/countdown/src/main/java/com/kieronquinn/app/smartspacer/plugin/countdown/ui/screens/configuration/ConfigurationViewModel.kt#L80C5