docs: function () {
        var $this = this;
  
        // colors validation
        if (this.settings.periodColors.length > 0) {
          $.each(this.settings.periodColors, function (index, color) {
            if (!$.inArray(color) || color.length !== 3) {
              throw new Error('Invalid periodColors');
            }
          });
        }
  
        // duration validation
        if ($.inArray(this.settings.periodDuration, [15, 30, 60]) === -1) {
          throw new Error('Invalid periodDuration');
        }
  
        this.periodInterval = 60 / this.settings.periodDuration;
        this.periodHeight = 24 * this.periodInterval;
        this.periodPosition = 40 / this.periodInterval;
  
        $(this.element).addClass('jqs').addClass('jqs-mode-' + this.settings.mode)
          .addClass('jqs').addClass('jqs-mode-' + this.settings.days);
  
        // Init events
        if (this.settings.mode === 'edit') {
          var position = 0;
          var helper = false;
  
          $(this.element).on('mousedown', '.jqs-day', function (event) {
            var offset = event.pageY - $(this).offset().top;
            position = Math.floor(offset / $this.periodPosition);
  
            if (!$(event.target).hasClass('jqs-period') && $(event.target).parents('.jqs-period').length === 0) {
              var time = '';
              if ($this.settings.periodDuration !== 15) {
                time = $this.periodInit(position, position + 1);
              }
  
              helper = $('<div>').addClass('jqs-period-helper').css({
                'height': $this.periodPosition,
                'top': position * $this.periodPosition
              }).append('<div class="jqs-period-helper-time">' + time + '</div>');
  
              $(this).append(helper);
            }
          });
  
          $(this.element).on('mousemove', '.jqs-day', function (event) {
            if (helper) {
              var offset = event.pageY - $(this).offset().top;
              var height = Math.round(offset / $this.periodPosition) - position;
              if (height <= 0) {
                height = 1;
              }
  
              helper.css({
                'height': height * $this.periodPosition
              });
  
              if (height >= 1) {
                $('.jqs-period-helper-time', helper).text($this.periodInit(position, position + height));
              } else {
                $('.jqs-period-helper-time', helper).text('');
              }
            }
          });
  
          $(this.element).on('mouseup', '.jqs-day', function (event) {
            if (!$(event.target).hasClass('jqs-period') && $(event.target).parents('.jqs-period').length === 0) {
              var offset = event.pageY - $(this).offset().top;
              var height = Math.round(offset / $this.periodPosition) - position;
              if (height <= 0) {
                height = 1;
              }
  
              $this.add($(this), position, height);
            }
  
            position = 0;
            if (helper) {
              helper.remove();
              helper = false;
            }
          });
  
          $(this.element).on('mouseenter', '.jqs-day', function () {
            var index = $(this).parents('td').index();
            $('.jqs-grid-day', $this.element).eq(index).addClass('jqs-grid-day-buttons');
          });
  
          $(this.element).on('mouseleave', '.jqs-day', function () {
            var index = $(this).parents('td').index();
            $('.jqs-grid-day', $this.element).eq(index).removeClass('jqs-grid-day-buttons');
          });
  
          $(this.element).on('click', '.jqs-period-remove', function () {
            var period = $(this).parents('.jqs-period');
            $this.remove(period);
          });
  
          $(this.element).on('click', '.jqs-period-duplicate', function () {
            var period = $(this).parents('.jqs-period');
            $this.duplicate(period);
          });
  
          $(this.element).on('click', '.jqs-day-remove', function () {
            var index = $(this).parents('.jqs-grid-day').index();
            var parent = $('.jqs-day', $this.element).eq(index);
            $this.removeAll(parent);
          });
  
          $(this.element).on('click', '.jqs-day-duplicate', function () {
            var index = $(this).parents('.jqs-grid-day').index();
            var parent = $('.jqs-day', $this.element).eq(index);
            $this.duplicateAll(parent);
          });
        }
  
        this.create();
        this.generate();
  
        this.settings.onInit.call(this, this.element);
      }