update the weekly repetition day if its a single day and start date changes
This commit is contained in:
parent
9e4ab1e667
commit
a956a18e6e
|
@ -469,6 +469,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
|||
updateEndDateText()
|
||||
updateEndTimeText()
|
||||
}
|
||||
checkWeeklyRepeatRule()
|
||||
} else {
|
||||
mEventEndDateTime = mEventEndDateTime.withDate(year, month + 1, day)
|
||||
updateEndDateText()
|
||||
|
@ -491,6 +492,15 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
|||
}
|
||||
}
|
||||
|
||||
private fun checkWeeklyRepeatRule() {
|
||||
if (isXWeeklyRepetition()) {
|
||||
val day = mRepeatRule
|
||||
if (day == MONDAY || day == TUESDAY || day == WEDNESDAY || day == THURSDAY || day == FRIDAY || day == SATURDAY || day == SUNDAY) {
|
||||
setRepeatRule(Math.pow(2.0, (mEventStartDateTime.dayOfWeek - 1).toDouble()).toInt())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateIconColors() {
|
||||
event_time_image.setColorFilter(config.textColor, PorterDuff.Mode.SRC_IN)
|
||||
event_repetition_image.setColorFilter(config.textColor, PorterDuff.Mode.SRC_IN)
|
||||
|
|
Loading…
Reference in New Issue