differentiate between Repeat every "fourth friday" and "last friday" when needed
This commit is contained in:
parent
6c2cbb6414
commit
af1dc2ff20
1 changed files with 13 additions and 1 deletions
|
@ -308,7 +308,19 @@ class EventActivity : SimpleActivity() {
|
|||
|
||||
private fun getAvailableYearlyRepetitionRules(): ArrayList<RadioItem> {
|
||||
val items = arrayListOf(RadioItem(REPEAT_SAME_DAY, getString(R.string.repeat_on_the_same_day_yearly)))
|
||||
items.add(RadioItem(REPEAT_ORDER_WEEKDAY, getRepeatXthDayInMonthString(true, REPEAT_ORDER_WEEKDAY)))
|
||||
|
||||
if (isLastWeekDayOfMonth()) {
|
||||
val order = (mEventStartDateTime.dayOfMonth - 1) / 7 + 1
|
||||
if (order == 4) {
|
||||
items.add(RadioItem(REPEAT_ORDER_WEEKDAY, getRepeatXthDayInMonthString(true, REPEAT_ORDER_WEEKDAY)))
|
||||
items.add(RadioItem(REPEAT_ORDER_WEEKDAY_USE_LAST, getRepeatXthDayInMonthString(true, REPEAT_ORDER_WEEKDAY_USE_LAST)))
|
||||
} else if (order == 5) {
|
||||
items.add(RadioItem(REPEAT_ORDER_WEEKDAY_USE_LAST, getRepeatXthDayInMonthString(true, REPEAT_ORDER_WEEKDAY_USE_LAST)))
|
||||
}
|
||||
} else {
|
||||
items.add(RadioItem(REPEAT_ORDER_WEEKDAY, getRepeatXthDayInMonthString(true, REPEAT_ORDER_WEEKDAY)))
|
||||
}
|
||||
|
||||
return items
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue