maxkeppeler / sheets-compose-dialogs

✨ Enhancing Android UIs: A Jetpack Compose Library supporting a wide range of common use-cases with Material Design 3 Dialogs, Popups, and Bottom Sheets. ✨
https://maxkeppeler.github.io/sheets-compose-dialogs/
Apache License 2.0
780 stars 32 forks source link

[Question] How to disable past days in calendar dialog with v1.3.0? #83

Open starry-shivam opened 4 months ago

starry-shivam commented 4 months ago

Hello, first off, thank you creating this library. I've been using it in some of my apps, and recently I updated from version 1.1.0 to 1.3.0. I noticed there were quite a few API changes, and while I managed to adapt most of them to maintain the state of my dialogs as they were in version 1.1.0, I'm struggling with disabling past days in the calendar. Previously, all I had to do was pass disabledTimeline = CalendarTimeline.PAST inside CalendarConfig, but in the latest version, there doesn't seem to be such an option. Instead, it only accepts a list of dates to disable, which isn't quite what I'm looking for. Any assistance in resolving this would be greatly appreciated. Thank you.

starry-shivam commented 4 months ago

Actually, don't mind it. Upon further digging, I found a new boundary parameter that I could use to achieve the same results.

LocalDate.now()..LocalDate.now().plusYears(100)

However, I must say that the previous implementation was much simpler, as users didn't have to write their own bounding logic to achieve the similar results.

maxkeppeler commented 4 months ago

I reopened the PR. You're right, even though it works flawlessly as it is right now, I will offer a way to simplify disabling the past or future days (inclusive or exclusive today). Maybe a different constructor. Thanks for the comment, hope you like this library.