badoualy / datepicker-timeline

An infinite scrolling timeline to pick a date
MIT License
464 stars 71 forks source link

intoroduce method to set last visible date. #2

Closed devDroidRaul closed 7 years ago

devDroidRaul commented 7 years ago

hi love the library u created from the inspiration of the design.

There occasion when u don't want the user to pink up the date after a given date, for example not beyond today's date.

To cover max use cases. can v make the adapter to look if the developer has set last visible date. if not we can have the infinite scrollable date picker as it is right now

badoualy commented 7 years ago

It could be done pretty easily, I'll look into it as soon as I have some free time

badoualy commented 7 years ago

Hey! Available with release 1.0.0 Use method setLastVisibleDate See sample for example :)

It might have some imprecision across years as the algo to get the day differences between the first and last visible dates is pretty basic (see https://github.com/badoualy/datepicker-timeline/blob/master/library/src/main/java/com/github/badoualy/datepicker/TimelineView.java#L269 )