mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
differentiate between Repeat every "fourth friday" and "last friday" when needed
This commit is contained in:
@@ -308,7 +308,19 @@ class EventActivity : SimpleActivity() {
|
|||||||
|
|
||||||
private fun getAvailableYearlyRepetitionRules(): ArrayList<RadioItem> {
|
private fun getAvailableYearlyRepetitionRules(): ArrayList<RadioItem> {
|
||||||
val items = arrayListOf(RadioItem(REPEAT_SAME_DAY, getString(R.string.repeat_on_the_same_day_yearly)))
|
val items = arrayListOf(RadioItem(REPEAT_SAME_DAY, getString(R.string.repeat_on_the_same_day_yearly)))
|
||||||
|
|
||||||
|
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, 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
|
return items
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user