jspanel/dist/extensions/datepicker/jspanel.datepicker.js
// method to restore selected dates or range
method to restore selected dates or range
method to restore selected dates or range
function restoreSelections(container) {
      var days = container.querySelectorAll('.jsPanel-cal-sub.day');
      var _iterator3 = _createForOfIteratorHelper(days),
          _step3;
      try {
        for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
          var _day = _step3.value;
          if (container.selectedDays.has(_day.dataset.date)) {
            _day.classList.add('selected');
          }
        } 
      } catch (err) {
        _iterator3.e(err);
      } finally {
        _iterator3.f();
      }
      if (container.selectedRange.size) {
        var rangeIterator = container.selectedRange.values();
        var rangeArray = rangeIterator.next().value.split('/');
        var _iterator4 = _createForOfIteratorHelper(days),
            _step4;
        try {
          for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
            var day = _step4.value;
            var date = day.dataset.date;
            if (date >= rangeArray[0] && date <= rangeArray[1]) {
              day.classList.add('selected', 'range'); 
              if (date === rangeArray[0]) {
                day.classList.add('remove-border-radius-right');
              } else if (date === rangeArray[1]) {
                day.classList.add('remove-border-radius-left');
              } else if (date > rangeArray[0] || date < rangeArray[1]) {
                day.classList.add('remove-border-radius-right', 'remove-border-radius-left');
              }
            }
          }
        } catch (err) {
          _iterator4.e(err);
        } finally {
          _iterator4.f();
        }
      }
    }
function restoreSelections ( container ) { var days = container . querySelectorAll ( '.jsPanel-cal-sub.day' ) ; var _iterator3 = _createForOfIteratorHelper ( days ) , _step3 ; try { for ( _iterator3 . s ( ) ; ! ( _step3 = _iterator3 . n ( ) ) . done ; ) { var _day = _step3 . value ; if ( container . selectedDays . has ( _day . dataset . date ) ) { _day . classList . add ( 'selected' ) ; } } } catch ( err ) { _iterator3 . e ( err ) ; } finally { _iterator3 . f ( ) ; } if ( container . selectedRange . size ) { var rangeIterator = container . selectedRange . values ( ) ; var rangeArray = rangeIterator . next ( ) . value . split ( '/' ) ; var _iterator4 = _createForOfIteratorHelper ( days ) , _step4 ; try { for ( _iterator4 . s ( ) ; ! ( _step4 = _iterator4 . n ( ) ) . done ; ) { var day = _step4 . value ; var date = day . dataset . date ; if ( date >= rangeArray [ 0 ] && date <= rangeArray [ 1 ] ) { day . classList . add ( 'selected' , 'range' ) ; if ( date === rangeArray [ 0 ] ) { day . classList . add ( 'remove-border-radius-right' ) ; } else if ( date === rangeArray [ 1 ] ) { day . classList . add ( 'remove-border-radius-left' ) ; } else if ( date > rangeArray [ 0 ] || date < rangeArray [ 1 ] ) { day . classList . add ( 'remove-border-radius-right' , 'remove-border-radius-left' ) ; } } } } catch ( err ) { _iterator4 . e ( err ) ; } finally { _iterator4 . f ( ) ; } } }
method to restore selected dates or range
method to restore selected dates or range
// restore selections of days // restore selection of a range // remove border radius of dates between start and end