From ed7d22c35d6ddea39284a31e751a2cc9f86332f3 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Mon, 18 Apr 2022 18:02:36 -0500 Subject: [android] Fixed date pickers by adding 1 to 0-based month number --- .../TrackerMap/android/details/reports/UnitReportsFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'androidApp/src/main/java/mx') diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt index 60222ff..6cc36bd 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt @@ -258,7 +258,7 @@ class UnitReportsFragment : Fragment() { val (from, to) = period.getObjectDates() fromDatePicker = DatePickerDialog(requireContext(), { p0, p1, p2, p3 -> - fromPickedDatetime = LocalDateTime(p1, p2, p3, from.hour, from.minute) + fromPickedDatetime = LocalDateTime(p1, p2 + 1, p3, from.hour, from.minute) fromTimePicker.show() }, from.year, from.monthNumber, from.dayOfMonth) fromDatePicker.datePicker.maxDate = Calendar.getInstance().timeInMillis @@ -276,7 +276,7 @@ class UnitReportsFragment : Fragment() { }, from.hour, from.minute, false) toDatePicker = DatePickerDialog(requireContext(), { p0, p1, p2, p3 -> - toPickedDatetime = LocalDateTime(p1, p2, p3, from.hour, from.minute) + toPickedDatetime = LocalDateTime(p1, p2 + 1, p3, from.hour, from.minute) toTimePicker.show() }, to.year, to.monthNumber, to.dayOfMonth) toDatePicker.datePicker.maxDate = Calendar.getInstance().timeInMillis -- cgit v1.2.3