Open allenwang-code opened 2 years ago
The weekday of the date is wrong if we look at the image below. Tue 6 Dec should be Mon 6 Dec as we can see the date of tomorrow is showing Wed 8 Dec correctly.
Tue 6 Dec
Mon 6 Dec
Wed 8 Dec
XML:
<com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker android:id="@+id/time_picker" android:layout_width="0dp" android:layout_height="150dp" android:layout_marginTop="24dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/time_option_radio_group" app:picker_itemSpacing="6dp" app:picker_mustBeOnFuture="true" app:picker_selectorColor="@android:color/transparent" app:picker_stepSizeHours="1" app:picker_stepSizeMinutes="15" app:picker_visibleItemCount="3" />
Code:
val calendar = Calendar.getInstance() calendar.time = userSelectedDate binding.timePicker.maxDate = LocalDateTime().plusWeeks(12).toDate() binding.timePicker.selectDate(calendar)
The weekday of the date is wrong if we look at the image below.
Tue 6 Dec
should beMon 6 Dec
as we can see the date of tomorrow is showingWed 8 Dec
correctly.XML:
Code: