paintRepeatPattern (method) {
        let _self = this,
            paintMethod = method ? method : 'repeat-on',
            repeatEnd = (moment(_self.clndr.options.constraints.endDate, _self.dateFormatInternal).isBefore(_self.clndr.intervalEnd)) ? _self.clndr.options.constraints.endDate : moment(_self.clndr.intervalEnd).format(_self.dateFormatInternal),
            recurDatesThisMonth = [];
            
        // It's not currently possible to do a `recur on x weekdays every y weeks` compound rule with moment-recur, so
        // we calculate a fortnightly repeat, and a `weekly on x weekdays` and then compare the week numbers to get the
        // desired dates.
        if (_self.$patternField.val() === 'fortnight') {
            let weeks = [],
                fortnightlyWeeks = _self.clndr.options.selectedDate.startOf('week').recur()
                                    .every(2).weeks()
                                    .startDate(_self.clndr.options.selectedDate)
                                    .endDate(repeatEnd)
                                    .all(),
                datesToPaint = _self.recurPattern
                                    .startDate(_self.clndr.options.constraints.startDate)
                                    .endDate(repeatEnd)
                                    .all();

            // Build an array of week numbers which hit the `every 2 weeks` pattern
            $.each(fortnightlyWeeks, function() {
                weeks.push(this.week());
            });

            // Grab weekly recurrence and use the ones that match the required week numbers
            $.each(datesToPaint, function() {
                if ($.inArray(this.week(), weeks) !== -1) {
                    recurDatesThisMonth.push(this);
                }
            });
        }
        else {
            recurDatesThisMonth = _self.recurPattern
                .startDate(_self.clndr.options.constraints.startDate)
                .endDate(repeatEnd)
                .all();
        }

        $.each(recurDatesThisMonth, function() {
            switch (paintMethod) {
                case 'repeat-on':
                    _self.styleRepeatOn(this);
                    break;
                case 'clear':
                default:
                    _self.styleClear(this);
                    break;
            }
        });
    }
/**
     * Calculates the dates within the currently viewed month which should be painted by the recurrence pattern, and paints
     * or unpaints them according to the `method`. The pattern will be retrieved from the clndr instance.
     * 
     * @param {string} method `repeat-on` will paint the dates, `clear` will unpaint them
     */
Calculates the dates within the currently viewed month which should be painted by the recurrence pattern, and paints
or unpaints them according to the `method`. The pattern will be retrieved from the clndr instance.

@param {string} method `repeat-on` will paint the dates, `clear` will unpaint them
Calculates the dates within the currently viewed month which should be painted by the recurrence pattern and paints or unpaints them according to the ` method ` . The pattern will be retrieved from the clndr instance . @param { string } method ` repeat - on ` will paint the dates ` clear ` will unpaint them
paintRepeatPattern (method) {
        let _self = this,
            paintMethod = method ? method : 'repeat-on',
            repeatEnd = (moment(_self.clndr.options.constraints.endDate, _self.dateFormatInternal).isBefore(_self.clndr.intervalEnd)) ? _self.clndr.options.constraints.endDate : moment(_self.clndr.intervalEnd).format(_self.dateFormatInternal),
            recurDatesThisMonth = [];
        if (_self.$patternField.val() === 'fortnight') {
            let weeks = [],
                fortnightlyWeeks = _self.clndr.options.selectedDate.startOf('week').recur()
                                    .every(2).weeks()
                                    .startDate(_self.clndr.options.selectedDate)
                                    .endDate(repeatEnd)
                                    .all(),
                datesToPaint = _self.recurPattern
                                    .startDate(_self.clndr.options.constraints.startDate)
                                    .endDate(repeatEnd)
                                    .all();
            $.each(fortnightlyWeeks, function() {
                weeks.push(this.week());
            });
            $.each(datesToPaint, function() {
                if ($.inArray(this.week(), weeks) !== -1) {
                    recurDatesThisMonth.push(this);
                }
            });
        }
        else {
            recurDatesThisMonth = _self.recurPattern
                .startDate(_self.clndr.options.constraints.startDate)
                .endDate(repeatEnd)
                .all();
        }
        $.each(recurDatesThisMonth, function() {
            switch (paintMethod) {
                case 'repeat-on':
                    _self.styleRepeatOn(this);
                    break;
                case 'clear':
                default:
                    _self.styleClear(this);
                    break;
            }
        });
    }
paintRepeatPattern ( method ) { let _self = this , paintMethod = method ? method : 'repeat-on' , repeatEnd = ( moment ( _self . clndr . options . constraints . endDate , _self . dateFormatInternal ) . isBefore ( _self . clndr . intervalEnd ) ) ? _self . clndr . options . constraints . endDate : moment ( _self . clndr . intervalEnd ) . format ( _self . dateFormatInternal ) , recurDatesThisMonth = [ ] ; if ( _self . $patternField . val ( ) === 'fortnight' ) { let weeks = [ ] , fortnightlyWeeks = _self . clndr . options . selectedDate . startOf ( 'week' ) . recur ( ) . every ( 2 ) . weeks ( ) . startDate ( _self . clndr . options . selectedDate ) . endDate ( repeatEnd ) . all ( ) , datesToPaint = _self . recurPattern . startDate ( _self . clndr . options . constraints . startDate ) . endDate ( repeatEnd ) . all ( ) ; $ . each ( fortnightlyWeeks , function ( ) { weeks . push ( this . week ( ) ) ; } ) ; $ . each ( datesToPaint , function ( ) { if ( $ . inArray ( this . week ( ) , weeks ) !== - 1 ) { recurDatesThisMonth . push ( this ) ; } } ) ; } else { recurDatesThisMonth = _self . recurPattern . startDate ( _self . clndr . options . constraints . startDate ) . endDate ( repeatEnd ) . all ( ) ; } $ . each ( recurDatesThisMonth , function ( ) { switch ( paintMethod ) { case 'repeat-on' : _self . styleRepeatOn ( this ) ; break ; case 'clear' : default : _self . styleClear ( this ) ; break ; } } ) ; }
Calculates the dates within the currently viewed month which should be painted by the recurrence pattern, and paints
 or unpaints them according to the `method`.
Calculates the dates within the currently viewed month which should be painted by the recurrence pattern and paints or unpaints them according to the ` method ` .
// It's not currently possible to do a `recur on x weekdays every y weeks` compound rule with moment-recur, so // we calculate a fortnightly repeat, and a `weekly on x weekdays` and then compare the week numbers to get the // desired dates. // Build an array of week numbers which hit the `every 2 weeks` pattern // Grab weekly recurrence and use the ones that match the required week numbers