SingleDateAndTimePicker
SingleDateAndTimePicker copied to clipboard
Year picking doesn't work
1.Set
.displayYears(true)
- pick a year.
- Click OK. Expected: Year is year picked Actual: Year remains current year
1.Set
.displayYears(true)
- pick a year.
- Click OK. Expected: Year is year picked Actual: Year remains current year
try the version on my fork
Any updates on this?
The best I can do is set it like this: .displayDays(false) .displayDaysOfMonth(true) .displayMonthNumbers(true) .displayMonth(true) .displayYears(true) .displayHours(true) .displayMinutes(true) .displayAmPm(false)
Then year picks correctly.
I like the library but this bug is really annoying. I am not able to change the year either
I make it work
<com.github.florent37.singledateandtimepicker.SingleDateAndTimePicker
android:id="@+id/templateInputDatePicker"
android:layout_width="0dp"
android:layout_height="@dimen/date_picker_height"
android:layout_marginTop="@dimen/default_margin_large_medium"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/templateInputDateTitleTextView"
app:picker_curved="true"
app:picker_cyclic="true"
app:picker_displayHours="true"
app:picker_displayMinutes="true"
app:picker_displayYears="true"
app:picker_displayDays="false"
app:picker_displayDaysOfMonth="true"
app:picker_displayMonth="true"
app:picker_selectedTextColor="@color/white"
app:picker_selectorColor="@color/white"
app:picker_textColor="@color/white_alpha_20" />
This is alternative solution to identify year.
It will display Date format like "Sun 23 Jan 2020"
SimpleDateFormat df = new SimpleDateFormat("E dd MMM yyyy"); .setDayFormatter(df)