fix #1205, change the day when appropriate at default event start time

This commit is contained in:
tibbi 2020-09-28 15:36:57 +02:00
parent 3a720a2eae
commit e8ed75d82b
1 changed files with 6 additions and 4 deletions

View File

@ -344,15 +344,17 @@ fun Context.getNewEventTimestampFromCode(dayCode: String): Long {
var dateTime = Formatter.getLocalDateTimeFromCode(dayCode).withHourOfDay(currHour)
var newDateTime = dateTime.plusHours(1).withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0)
if (defaultStartTime != -1) {
return if (defaultStartTime == -1) {
newDateTime.seconds()
} else {
val hours = defaultStartTime / 60
val minutes = defaultStartTime % 60
dateTime = Formatter.getLocalDateTimeFromCode(dayCode).withHourOfDay(hours).withMinuteOfHour(minutes)
newDateTime = dateTime
}
// make sure the date doesn't change
return newDateTime.withDate(dateTime.year, dateTime.monthOfYear, dateTime.dayOfMonth).seconds()
newDateTime.withDate(dateTime.year, dateTime.monthOfYear, dateTime.dayOfMonth).seconds()
}
}
fun Context.getSyncedCalDAVCalendars() = calDAVHelper.getCalDAVCalendars(config.caldavSyncedCalendarIds, false)