check if given day is today nicer
This commit is contained in:
parent
3288435662
commit
8fad741fcc
|
@ -125,11 +125,10 @@ class MonthlyCalendarImpl(val mCallback: MonthlyCalendar, val mContext: Context)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isToday(targetDate: DateTime, curDayInMonth: Int): Boolean {
|
private fun isToday(targetDate: DateTime, curDayInMonth: Int): Boolean {
|
||||||
try {
|
return if (curDayInMonth > targetDate.dayOfMonth().maximumValue)
|
||||||
return targetDate.withDayOfMonth(curDayInMonth).toString(Formatter.DAYCODE_PATTERN) == mToday
|
false
|
||||||
} catch(ignored: Exception) {
|
else
|
||||||
return false
|
targetDate.withDayOfMonth(curDayInMonth).toString(Formatter.DAYCODE_PATTERN) == mToday
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private val monthName: String
|
private val monthName: String
|
||||||
|
|
Loading…
Reference in New Issue