From ed9d0a42cdb34d61132f9a00d6d64f4dc48e2fa3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 19 Oct 2016 19:01:27 +0200 Subject: [PATCH] lets use DateTime for getting february days cnt --- .../simplemobiletools/calendar/fragments/YearFragment.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/YearFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/YearFragment.kt index d63f82bae..4bf2a7c6b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/YearFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/YearFragment.kt @@ -9,7 +9,7 @@ import com.simplemobiletools.calendar.Constants import com.simplemobiletools.calendar.NavigationListener import com.simplemobiletools.calendar.R import kotlinx.android.synthetic.main.year_fragment.view.* -import java.util.* +import org.joda.time.DateTime class YearFragment : Fragment() { private var mListener: NavigationListener? = null @@ -20,8 +20,8 @@ class YearFragment : Fragment() { mYear = arguments.getInt(Constants.YEAR_LABEL) - val calendar = GregorianCalendar(mYear, Calendar.FEBRUARY, 1) - view.february_value.setDays(calendar.getActualMaximum(Calendar.DAY_OF_MONTH)) + val days = DateTime().withYear(mYear).withDayOfMonth(1).withMonthOfYear(2).dayOfMonth().maximumValue + view.february_value.setDays(days) return view }