check if given day is today nicer

This commit is contained in:
tibbi 2017-06-03 16:46:25 +02:00
parent 3288435662
commit 8fad741fcc
1 changed files with 4 additions and 5 deletions

View File

@ -125,11 +125,10 @@ class MonthlyCalendarImpl(val mCallback: MonthlyCalendar, val mContext: Context)
}
private fun isToday(targetDate: DateTime, curDayInMonth: Int): Boolean {
try {
return targetDate.withDayOfMonth(curDayInMonth).toString(Formatter.DAYCODE_PATTERN) == mToday
} catch(ignored: Exception) {
return false
}
return if (curDayInMonth > targetDate.dayOfMonth().maximumValue)
false
else
targetDate.withDayOfMonth(curDayInMonth).toString(Formatter.DAYCODE_PATTERN) == mToday
}
private val monthName: String