set repeat limit to Forever if its set to earlier than event end

This commit is contained in:
tibbi 2017-02-05 22:06:04 +01:00
parent 08ed97f4d6
commit 7abcf71a0a
1 changed files with 7 additions and 2 deletions

View File

@ -128,8 +128,13 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
private val repetitionLimitDateSetListener = DatePickerDialog.OnDateSetListener { view, year, monthOfYear, dayOfMonth ->
val repeatLimitDateTime = DateTime().withDate(year, monthOfYear + 1, dayOfMonth).withTime(0, 0, 0, 0)
event_repetition_limit.text = Formatter.getDate(applicationContext, repeatLimitDateTime, false)
mRepeatLimit = repeatLimitDateTime.seconds()
if (repeatLimitDateTime.seconds() < mEvent.endTS) {
event_repetition_limit.text = resources.getString(R.string.forever)
mRepeatLimit = 0
} else {
event_repetition_limit.text = Formatter.getDate(applicationContext, repeatLimitDateTime, false)
mRepeatLimit = repeatLimitDateTime.seconds()
}
}
private fun updateReminderText() {