iamvivekkaushik / DatePickerTimelineFlutter

Flutter Date Picker Library that provides a calendar as a horizontal timeline
Apache License 2.0
283 stars 198 forks source link

please add minDate & maxDate option #19

Closed topex-psy closed 4 years ago

topex-psy commented 4 years ago

Is your feature request related to a problem? Please describe. Yes, I need to set min & max dates to show in the list, not confused with currentDate. For example, I want today must be the max date, thus user can only scroll to past dates and prevent user from selecting future dates.

Describe the solution you'd like Please add minDate and maxdate in the constructor as optional.

Describe alternatives you've considered Or maybe as an alternative also add type with value "future" (calendar will show current & future dates) or "past" (calendar will show current & past dates).

Additional context Nothing.

iamvivekkaushik commented 4 years ago

Hi, I don't understand the issue you are having. You can already set a max date by passing daysCount to constructor. and currentDate is always the starting point.

topex-psy commented 4 years ago

Hi, I don't understand the issue you are having. You can already set a max date by passing daysCount to constructor. and currentDate is always the starting point.

That's the issue. currentDate is represent to selected date, right? So it should not the starting point. Let say currentDate in the constructor is set to DateTime.now(), but I want users be able scroll to the past dates like yesterday and more (and not tomorrow or future, because I want today is end point). Maybe add daysPastCount option, please.

topex-psy commented 4 years ago

Or would you give me code example to achieve my purpose?

hinterlandcreative commented 4 years ago

I would like this too? How is it possible to select past dates?

topex-psy commented 4 years ago

I did fork this repo for that purpose. I have better version included in my app, but I didn't commit it to this fork repo. If you don't mind, here is it: https://github.com/topex-psy/DatePickerTimelineFlutter

you can download and in the pubspec.yaml include the folder like below:

date_picker_timeline_custom:
  path: library/date_picker_timeline_custom