updating the comments
This commit is contained in:
parent
61ed3a2b90
commit
c03c2c1899
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue