lets use DateTime for getting february days cnt

This commit is contained in:
tibbi 2016-10-19 19:01:27 +02:00
parent ffc528ce15
commit ed9d0a42cd
1 changed files with 3 additions and 3 deletions

View File

@ -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
}