lets use DateTime for getting february days cnt
This commit is contained in:
parent
ffc528ce15
commit
ed9d0a42cd
|
@ -9,7 +9,7 @@ import com.simplemobiletools.calendar.Constants
|
||||||
import com.simplemobiletools.calendar.NavigationListener
|
import com.simplemobiletools.calendar.NavigationListener
|
||||||
import com.simplemobiletools.calendar.R
|
import com.simplemobiletools.calendar.R
|
||||||
import kotlinx.android.synthetic.main.year_fragment.view.*
|
import kotlinx.android.synthetic.main.year_fragment.view.*
|
||||||
import java.util.*
|
import org.joda.time.DateTime
|
||||||
|
|
||||||
class YearFragment : Fragment() {
|
class YearFragment : Fragment() {
|
||||||
private var mListener: NavigationListener? = null
|
private var mListener: NavigationListener? = null
|
||||||
|
@ -20,8 +20,8 @@ class YearFragment : Fragment() {
|
||||||
|
|
||||||
mYear = arguments.getInt(Constants.YEAR_LABEL)
|
mYear = arguments.getInt(Constants.YEAR_LABEL)
|
||||||
|
|
||||||
val calendar = GregorianCalendar(mYear, Calendar.FEBRUARY, 1)
|
val days = DateTime().withYear(mYear).withDayOfMonth(1).withMonthOfYear(2).dayOfMonth().maximumValue
|
||||||
view.february_value.setDays(calendar.getActualMaximum(Calendar.DAY_OF_MONTH))
|
view.february_value.setDays(days)
|
||||||
|
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue