Naveen 2022-10-20 23:44:25 +05:30
parent c444c476b3
commit cf20782fd9
2 changed files with 4 additions and 3 deletions

View File

@ -212,6 +212,7 @@ class IcsImporter(val activity: SimpleActivity) {
val eventType = eventTypes.firstOrNull { it.id == curEventTypeId } val eventType = eventTypes.firstOrNull { it.id == curEventTypeId }
val source = if (calDAVCalendarId == 0 || eventType?.isSyncedEventType() == false) SOURCE_IMPORTED_ICS else "$CALDAV-$calDAVCalendarId" val source = if (calDAVCalendarId == 0 || eventType?.isSyncedEventType() == false) SOURCE_IMPORTED_ICS else "$CALDAV-$calDAVCalendarId"
val isAllDay = curFlags and FLAG_ALL_DAY != 0
val event = Event( val event = Event(
null, null,
curStart, curStart,
@ -231,7 +232,7 @@ class IcsImporter(val activity: SimpleActivity) {
curRepeatExceptions, curRepeatExceptions,
"", "",
curImportId, curImportId,
DateTimeZone.getDefault().id, if (isAllDay) DateTimeZone.UTC.id else DateTimeZone.getDefault().id,
curFlags, curFlags,
curEventTypeId, curEventTypeId,
0, 0,
@ -240,7 +241,7 @@ class IcsImporter(val activity: SimpleActivity) {
curAvailability curAvailability
) )
if (event.getIsAllDay() && curEnd > curStart) { if (isAllDay && curEnd > curStart) {
event.endTS -= DAY event.endTS -= DAY
// fix some glitches related to daylight saving shifts // fix some glitches related to daylight saving shifts

View File

@ -102,7 +102,7 @@ class Parser {
parseLongFormat(edited, value.endsWith("Z")) parseLongFormat(edited, value.endsWith("Z"))
} else { } else {
val dateTimeFormat = DateTimeFormat.forPattern("yyyyMMdd") val dateTimeFormat = DateTimeFormat.forPattern("yyyyMMdd")
dateTimeFormat.parseDateTime(edited).withHourOfDay(5).seconds() dateTimeFormat.parseDateTime(edited).withHourOfDay(13).seconds()
} }
} }