mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-18 20:50:40 +01:00
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 com.simplemobiletools.calendar.pro.models.Event
|
||||||
import org.joda.time.DateTimeZone
|
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() {
|
fun Event.toLocalAllDayEvent() {
|
||||||
require(this.getIsAllDay()) { "Must be an all day event!" }
|
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() {
|
fun Event.toUtcAllDayEvent() {
|
||||||
require(getIsAllDay()) { "Must be an all day event!" }
|
require(getIsAllDay()) { "Must be an all day event!" }
|
||||||
|
|
||||||
if (endTS >= startTS) {
|
if (endTS >= startTS) {
|
||||||
endTS += TWELVE_HOURS
|
endTS += TWELVE_HOURS
|
||||||
}
|
}
|
||||||
|
|
||||||
timeZone = DateTimeZone.UTC.id
|
timeZone = DateTimeZone.UTC.id
|
||||||
startTS = Formatter.getShiftedUtcTS(startTS)
|
startTS = Formatter.getShiftedUtcTS(startTS)
|
||||||
endTS = Formatter.getShiftedUtcTS(endTS)
|
endTS = Formatter.getShiftedUtcTS(endTS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user