display the year in weekly view if its not the current

This commit is contained in:
tibbi 2017-01-22 17:00:00 +01:00
parent 6151604759
commit 22694336e1
1 changed files with 4 additions and 1 deletions

View File

@ -246,7 +246,10 @@ class MainActivity : SimpleActivity(), EventListFragment.DeleteListener {
val endDateTime = Formatter.getDateTimeFromTS(timestamp + secondsInWeek)
val startMonthName = Formatter.getMonthName(this, startDateTime.monthOfYear)
if (startDateTime.monthOfYear == endDateTime.monthOfYear) {
title = startMonthName
var newTitle = startMonthName
if (startDateTime.year != DateTime().year)
newTitle += " - ${startDateTime.year}"
title = newTitle
} else {
val endMonthName = Formatter.getMonthName(this, endDateTime.monthOfYear)
title = "$startMonthName - $endMonthName"