mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-31 19:05:01 +01:00
differentiate between Repeat every "fourth friday" and "last friday" when needed
This commit is contained in:
parent
6c2cbb6414
commit
af1dc2ff20
@ -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…
x
Reference in New Issue
Block a user