florent37 / SingleDateAndTimePicker

You can now select a date and a time with only one widget !
Apache License 2.0
1.02k stars 333 forks source link

Year picking doesn't work #192

Open CarsonRedeye opened 5 years ago

CarsonRedeye commented 5 years ago

1.Set .displayYears(true)

  1. pick a year.
  2. Click OK. Expected: Year is year picked Actual: Year remains current year
nilput commented 5 years ago

1.Set .displayYears(true)

  1. pick a year.
  2. Click OK. Expected: Year is year picked Actual: Year remains current year

try the version on my fork

10erlosh commented 5 years ago

Any updates on this?

CarsonRedeye commented 5 years ago

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.

agustinsivoplas commented 5 years ago

I like the library but this bug is really annoying. I am not able to change the year either

agustinsivoplas commented 5 years ago
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" />
dharmesh395 commented 4 years ago

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)