twinssbc / Ionic2-Calendar

A calendar component based on Ionic framework
https://ionic-calendar-demo.stackblitz.io
MIT License
389 stars 199 forks source link

MonthView: Mantain selection when changing month #218

Closed GrindingOgre closed 7 years ago

GrindingOgre commented 7 years ago

Actually, when you change the month (talking abount month view), currentDate is updated with the same day of the new month. For example:

i've selected the 10th of October, swiping right to November, the new currentDate will be 10th of November.

Is there a way to block this update? I don't want to change my selection between months.

twinssbc commented 7 years ago

@GrindingOgre There's a "autoSelect" option that you can set to false to disable auto selection when swiping. But it seems you have special use case of the selected date? When a date is selected, the calendar will do two things

  1. The cell is marked as selected state.
  2. The events happen on that date will be displayed in the event detail section If you disable autoSelect, when you swipe to next month, it won't select a new date in the next month, the previous selection will also lost. Because the calendar only cares about the current view, not previous or next view. If you want to maintain the selection across different months, you need to store it by yourselft
GrindingOgre commented 7 years ago

It seems that the autoselect could be what i was looking for...

Thanks a lot!