Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Countdown to event start instead of to the reminder ([#1073])

## [1.10.3] - 2026-02-14
### Changed
- Updated translations
Expand Down Expand Up @@ -237,6 +240,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#1003]: https://github.com/FossifyOrg/Calendar/issues/1003
[#1019]: https://github.com/FossifyOrg/Calendar/issues/1019
[#1024]: https://github.com/FossifyOrg/Calendar/issues/1024
[#1073]: https://github.com/FossifyOrg/Calendar/issues/1073

[Unreleased]: https://github.com/FossifyOrg/Calendar/compare/1.10.3...HEAD
[1.10.3]: https://github.com/FossifyOrg/Calendar/compare/1.10.2...1.10.3
Expand Down
11 changes: 5 additions & 6 deletions app/src/main/kotlin/org/fossify/calendar/extensions/Context.kt
Original file line number Diff line number Diff line change
Expand Up @@ -233,26 +233,25 @@ fun Context.scheduleNextEventReminder(event: Event, showToasts: Boolean) {
}

fun Context.scheduleEventIn(notifyAtMillis: Long, event: Event, showToasts: Boolean) {
val now = System.currentTimeMillis()
if (notifyAtMillis < now) {
val now = System.currentTimeMillis() / 1000
if (event.getEventStartTS() < now) {
if (showToasts) {
toast(org.fossify.commons.R.string.saving)
}
return
}

val newNotifyAtMillis = notifyAtMillis + 1000
if (showToasts) {
val secondsTillNotification = (newNotifyAtMillis - now) / 1000
val secondsTillEvent = event.getEventStartTS() - now
val msg = String.format(
getString(org.fossify.commons.R.string.time_remaining),
formatSecondsToTimeString(secondsTillNotification.toInt())
formatSecondsToTimeString(secondsTillEvent.toInt())
)
toast(msg)
}

val pendingIntent = getNotificationIntent(event)
setExactAlarm(newNotifyAtMillis, pendingIntent)
setExactAlarm(notifyAtMillis + 1000, pendingIntent)
}

// hide the actual notification from the top bar
Expand Down
Loading