updating the comments

This commit is contained in:
Tibor Kaputa 2022-11-03 12:50:17 +01:00 committed by GitHub
parent 61ed3a2b90
commit c03c2c1899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,7 @@ import com.simplemobiletools.calendar.pro.helpers.TWELVE_HOURS
import com.simplemobiletools.calendar.pro.models.Event
import org.joda.time.DateTimeZone
/** Shifts all-day events to local timezone such that the event starts and ends on the same time as in UTC */
// shifts all-day events to local timezone such that the event starts and ends on the same time as in UTC
fun Event.toLocalAllDayEvent() {
require(this.getIsAllDay()) { "Must be an all day event!" }
@ -17,13 +17,14 @@ fun Event.toLocalAllDayEvent() {
}
}
/** Shifts all-day events to UTC such that the event starts on the same time in UTC too */
// shifts all-day events to UTC such that the event starts on the same time in UTC too
fun Event.toUtcAllDayEvent() {
require(getIsAllDay()) { "Must be an all day event!" }
if (endTS >= startTS) {
endTS += TWELVE_HOURS
}
timeZone = DateTimeZone.UTC.id
startTS = Formatter.getShiftedUtcTS(startTS)
endTS = Formatter.getShiftedUtcTS(endTS)