mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 12:20:51 +01:00
fix #1205, change the day when appropriate at default event start time
This commit is contained in:
parent
3a720a2eae
commit
e8ed75d82b
@ -344,15 +344,17 @@ fun Context.getNewEventTimestampFromCode(dayCode: String): Long {
|
|||||||
var dateTime = Formatter.getLocalDateTimeFromCode(dayCode).withHourOfDay(currHour)
|
var dateTime = Formatter.getLocalDateTimeFromCode(dayCode).withHourOfDay(currHour)
|
||||||
var newDateTime = dateTime.plusHours(1).withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0)
|
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 hours = defaultStartTime / 60
|
||||||
val minutes = defaultStartTime % 60
|
val minutes = defaultStartTime % 60
|
||||||
dateTime = Formatter.getLocalDateTimeFromCode(dayCode).withHourOfDay(hours).withMinuteOfHour(minutes)
|
dateTime = Formatter.getLocalDateTimeFromCode(dayCode).withHourOfDay(hours).withMinuteOfHour(minutes)
|
||||||
newDateTime = dateTime
|
newDateTime = dateTime
|
||||||
}
|
|
||||||
|
|
||||||
// make sure the date doesn't change
|
// 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)
|
fun Context.getSyncedCalDAVCalendars() = calDAVHelper.getCalDAVCalendars(config.caldavSyncedCalendarIds, false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user