Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Wrong week day #330

Open
allenwang-code opened this issue Dec 7, 2021 · 0 comments
Open

Wrong week day #330

allenwang-code opened this issue Dec 7, 2021 · 0 comments

Comments

@allenwang-code
Copy link

allenwang-code commented Dec 7, 2021

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.

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)

example

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant