correctDays(days, options) {
    // PARSE THRU DAYS AND UPDATE IF NEEDED
    let getSelected = this.getAllSelectedValues.bind(this);

    let all = getSelected(options);

    let selected_month = all[1];
    let selected_year = all[0];
    let selected_day = all[2];

    console.log(days)
    console.log(days.includes("08"));
    console.log('all is -> ' + all);
    console.log('month', selected_month, 'day', selected_day, 'year', selected_year);
    let daysInSelectedMonth = this.daysInCurrentMonth.bind(this);
    let daysInCurrentMonth = this.daysInSelectedMonth;
    let maxDays = daysInSelectedMonth(Number(selected_month) - 1, Number(selected_year));
    let month_offset = maxDays - daysInCurrentMonth;
    daysInCurrentMonth = maxDays;
    console.log('updated daysInCurrentMonth to ' + daysInCurrentMonth);
    console.log('mo offset: ' + month_offset);
    console.log('old days: ' + (daysInCurrentMonth - month_offset));
    // Update days based on max days in month
    if (Number(month_offset) != 0 && Math.abs(month_offset) < 5) {
      for (let option of options) {
        let section = option.getAttribute('data-name');
        if (section == 'day') {
          let old_day = Number(option.innerHTML);
          // If 8 is on the screen don't update because it'll throw off the whole col
          if (old_day >= 8 && (days.includes(String((daysInCurrentMonth - month_offset))) || Number(old_day) > maxDays)) {
            let new_day = Math.abs(old_day + month_offset);
            if (new_day < 10 && new_day > -1) {
              new_day = '0' + String(new_day)
            }
            option.innerHTML = String(new_day)
            option.setAttribute('data-value', String(new_day))
          }
        }
      }
    }
  }
// Correct days based on selected month 
Correct days based on selected month
Correct days based on selected month
correctDays(days, options) {
    let getSelected = this.getAllSelectedValues.bind(this);
    let all = getSelected(options);
    let selected_month = all[1];
    let selected_year = all[0];
    let selected_day = all[2];
    console.log(days)
    console.log(days.includes("08"));
    console.log('all is -> ' + all);
    console.log('month', selected_month, 'day', selected_day, 'year', selected_year);
    let daysInSelectedMonth = this.daysInCurrentMonth.bind(this);
    let daysInCurrentMonth = this.daysInSelectedMonth;
    let maxDays = daysInSelectedMonth(Number(selected_month) - 1, Number(selected_year));
    let month_offset = maxDays - daysInCurrentMonth;
    daysInCurrentMonth = maxDays;
    console.log('updated daysInCurrentMonth to ' + daysInCurrentMonth);
    console.log('mo offset: ' + month_offset);
    console.log('old days: ' + (daysInCurrentMonth - month_offset));
    if (Number(month_offset) != 0 && Math.abs(month_offset) < 5) {
      for (let option of options) {
        let section = option.getAttribute('data-name');
        if (section == 'day') {
          let old_day = Number(option.innerHTML);
          if (old_day >= 8 && (days.includes(String((daysInCurrentMonth - month_offset))) || Number(old_day) > maxDays)) {
            let new_day = Math.abs(old_day + month_offset);
            if (new_day < 10 && new_day > -1) {
              new_day = '0' + String(new_day)
            }
            option.innerHTML = String(new_day)
            option.setAttribute('data-value', String(new_day))
          }
        }
      }
    }
  }
correctDays ( days , options ) { let getSelected = this . getAllSelectedValues . bind ( this ) ; let all = getSelected ( options ) ; let selected_month = all [ 1 ] ; let selected_year = all [ 0 ] ; let selected_day = all [ 2 ] ; console . log ( days ) console . log ( days . includes ( "08" ) ) ; console . log ( 'all is -> ' + all ) ; console . log ( 'month' , selected_month , 'day' , selected_day , 'year' , selected_year ) ; let daysInSelectedMonth = this . daysInCurrentMonth . bind ( this ) ; let daysInCurrentMonth = this . daysInSelectedMonth ; let maxDays = daysInSelectedMonth ( Number ( selected_month ) - 1 , Number ( selected_year ) ) ; let month_offset = maxDays - daysInCurrentMonth ; daysInCurrentMonth = maxDays ; console . log ( 'updated daysInCurrentMonth to ' + daysInCurrentMonth ) ; console . log ( 'mo offset: ' + month_offset ) ; console . log ( 'old days: ' + ( daysInCurrentMonth - month_offset ) ) ; if ( Number ( month_offset ) != 0 && Math . abs ( month_offset ) < 5 ) { for ( let option of options ) { let section = option . getAttribute ( 'data-name' ) ; if ( section == 'day' ) { let old_day = Number ( option . innerHTML ) ; if ( old_day >= 8 && ( days . includes ( String ( ( daysInCurrentMonth - month_offset ) ) ) || Number ( old_day ) > maxDays ) ) { let new_day = Math . abs ( old_day + month_offset ) ; if ( new_day < 10 && new_day > - 1 ) { new_day = '0' + String ( new_day ) } option . innerHTML = String ( new_day ) option . setAttribute ( 'data-value' , String ( new_day ) ) } } } } }
Correct days based on selected month
Correct days based on selected month
// PARSE THRU DAYS AND UPDATE IF NEEDED // Update days based on max days in month // If 8 is on the screen don't update because it'll throw off the whole col