RoXuS/range-datepicker

Previous and Next month changing issue

Closed this issue · 7 comments

mh2k9 commented

There has issue to change the previous/next month. When I try to change the month I got the following issues:

range-datepicker-calendar.js:199 Uncaught TypeError: Cannot read property 'classList' of null
at HTMLElement._handlePrevMonth (range-datepicker-calendar.js:199)
at HTMLElement.handler (template-stamp.html:92)
at Object._fire (gestures.html:565)
at Object.forward (gestures.html:927)
at Object.touchend (gestures.html:912)
at HTMLElement._handleNative (gestures.html:355)

RoXuS commented

Hi @mh2k9, this is already on master no -> d384838 ??

mh2k9 commented

Yes @RoXuS, it is that.

RoXuS commented

@mh2k9 so, we can close thise issue ?

mh2k9 commented

Thanks, @RoXuS.
If I use the Narrow month (ie, single month) I can't enable next or previous month selection. Although I can enable only next month change it throws an exception.

Uncaught TypeError: Cannot read property '_handleNextMonth' of null
at HTMLElement._handleNextMonth (range-datepicker-behavior.js:28)
at HTMLElement.handler (template-stamp.html:92)
at HTMLElement._handleNextMonth (range-datepicker-calendar.js:174)
at HTMLElement.handler (template-stamp.html:92)
at Object._fire (gestures.html:565)
at Object.forward (gestures.html:927)
at Object.touchend (gestures.html:912)
at HTMLElement._handleNative (gestures.html:355)

My element is look like:

<dom-if if="[[_isNarrow(forceNarrow, narrow)]]"> <template> <div class="horizontal-section-container centered"> <range-datepicker-calendar disabled-days="[[disabledDays]]" min="[[min]]" max="[[max]]" on-new-year-is-manually-selected="_handleNewYearSelected" enable-year-change="[[enableYearChange]]" next no-range="[[noRange]]" on-prev-month="_handlePrevMonth" on-next-month="_handleNextMonth" hovered-date="{{_hoveredDate}}" date-to="{{dateTo}}" date-from="{{dateFrom}}" locale="[[locale]]" id="firstDatePicker" month="[[_monthPlus]]" class-name="firstDatePicker" cal-pos="[[calPos]]" year="[[_yearPlus]]"> </range-datepicker-calendar> </div> </template> </dom-if>

How can I enable both next and previous month changing events for single month calendar?

mh2k9 commented

Thanks again @RoXuS, I have solved this by adding two parameters next and prev. Commit ID -> 8712967

RoXuS commented

So @mh2k9 all is ok for you ??

mh2k9 commented

@RoXuS, Yes it seems to be working fine. You can close this ticket.