iamvivekkaushik/DatePickerTimelineFlutter

Enable previous month

Closed this issue · 3 comments

Enable previous month
Can you add a feature to Enable the previous month, that would be a great help?

The solution you'd like
If you can give numberOfPreviousMonths as an option It is very useful to enable previous months too. If you can add a feature to Enable the previous month, that would be a great help?

should be able to do something like that:

DatePicker(
                      DateTime.now().sub(Duration(days: 31)),
                      initialSelectedDate: DateTime.now(),
                      selectionColor: Colors.black,
                      selectedTextColor: Colors.white,
                      daysCount: 31,
                      controller: _datePickercontroller,
                      onDateChange: (date) {
                        // New date selected
                      },

It shows

The method 'sub' isn't defined for the type 'DateTime'.

How do I Solve this?

@ajinzrathod is substract but don't work as u mean