maxkeppeler / sheets

⭐ ‎‎‎‏‏‎ ‎Offers a range of beautiful sheets (dialogs & bottom sheets) for quick use in your project. Includes many ways to customize sheets.
https://maxkeppeler.github.io/sheets/
Apache License 2.0
921 stars 77 forks source link

Set custom selected day on CalendarSheets #69

Closed mena97villalobos closed 3 years ago

mena97villalobos commented 3 years ago

I need to set a custom date on CalendarSheets Possible solution is to modify private val today = LocalDate.now() on CalendarSheets.kt and add a function to set the value to a custom date

maxkeppeler commented 3 years ago

There's a misunderstanding. The today date is supposed to be an indicator for the user to know the current day in the calendar view. The today indicated day and a day that is selected look different. The today-day is also still selectable.

Correct me if I'm wrong, but I think you wanted to have a method to pass the date or date range that was previously selected and display this state when the CalendarSheet was opened again.

Following variables are used for this:

For a single date selection: private var selectedDate: LocalDate? = null

For a date range selection: private var selectedDateStart: LocalDate? = null private var selectedDateEnd: LocalDate? = null

Out of your PR we could change it a bit to still make the Today-day indicator custom. However the other variables need to be used for setting up default selected date or date range.

Let me know if I understood you and the situation correctly. (And sorry for not having react quicker.)

mena97villalobos commented 3 years ago

Hey! Sure, you got it correctly, I just wanted something like the today value to set a "hint" of some sort instead of just selecting the value with the values you mentioned. Anyway, I can work on changing the variables you mentioned and creating something similar to the today indicator as you suggested. Thanks for the heads up!

On Mon, May 24, 2021 at 7:30 AM Maximilian Keppeler < @.***> wrote:

There's a misunderstanding. The today date is supposed to be an indicator for the user to know the current day in the calendar view. The today indicated day and a day that is selected look different. The today-day is also still selectable.

Correct me if I'm wrong, but I think you wanted to have a method to pass the date or date range that was previously selected and display this state when the CalendarSheet was opened again.

Following variables are used for this:

For a single date selection: private var selectedDate: LocalDate? = null

For a date range selection: private var selectedDateStart: LocalDate? = null private var selectedDateEnd: LocalDate? = null

Out of your PR we could change it a bit to still make the Today-day indicator custom. However the other variables need to be used for setting up default selected date or date range.

Let me know if I understood you and the situation correctly. (And sorry for not having react quicker.)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maxkeppeler/sheets/issues/69#issuecomment-847043835, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFTFS3HO3VOK325CZD6HL6LTPJIHDANCNFSM45FCOXJQ .

mena97villalobos commented 3 years ago

I updated the code you can check it again, let me know what you think