dist/jquery.schedule.js
function (args) {
      var $this = this;
      var dataImport = args[1];
      var ret = [];
      $.each(dataImport, function (index, data) {
        $.each(data.periods, function (index, period) {
          var parent = $('.jqs-day', $this.element).eq(data.day);
          var options = {};
          var height, position;
          if ($.isArray(period)) {
            position = $this.positionFormat(period[0]);
            height = $this.positionFormat(period[1]);
          } else {
            position = $this.positionFormat(period.start);
            height = $this.positionFormat(period.end);
            options = period;
          }

          if (height === 0) {
            height = $this.periodHeight;
          }

          var status = true;
          if (!$this.add(parent, position, height - position, options)) {
            status = false;
          }

          ret.push({
            day: data.day,
            period: [
              $this.periodFormat(position),
              $this.periodFormat(height)
            ],
            status: status
          });
        });
      });

      return JSON.stringify(ret);
    }
function (args) {
      var $this = this;
      var dataImport = args[1];
      var ret = [];
      $.each(dataImport, function (index, data) {
        $.each(data.periods, function (index, period) {
          var parent = $('.jqs-day', $this.element).eq(data.day);
          var options = {};
          var height, position;
          if ($.isArray(period)) {
            position = $this.positionFormat(period[0]);
            height = $this.positionFormat(period[1]);
          } else {
            position = $this.positionFormat(period.start);
            height = $this.positionFormat(period.end);
            options = period;
          }

          if (height === 0) {
            height = $this.periodHeight;
          }

          var status = true;
          if (!$this.add(parent, position, height - position, options)) {
            status = false;
          }

          ret.push({
            day: data.day,
            period: [
              $this.periodFormat(position),
              $this.periodFormat(height)
            ],
            status: status
          });
        });
      });

      return JSON.stringify(ret);
    }
function ( args ) { var $this = this ; var dataImport = args [ 1 ] ; var ret = [ ] ; $ . each ( dataImport , function ( index , data ) { $ . each ( data . periods , function ( index , period ) { var parent = $ ( '.jqs-day' , $this . element ) . eq ( data . day ) ; var options = { } ; var height , position ; if ( $ . isArray ( period ) ) { position = $this . positionFormat ( period [ 0 ] ) ; height = $this . positionFormat ( period [ 1 ] ) ; } else { position = $this . positionFormat ( period . start ) ; height = $this . positionFormat ( period . end ) ; options = period ; } if ( height === 0 ) { height = $this . periodHeight ; } var status = true ; if ( ! $this . add ( parent , position , height - position , options ) ) { status = false ; } ret . push ( { day : data . day , period : [ $this . periodFormat ( position ) , $this . periodFormat ( height ) ] , status : status } ) ; } ) ; } ) ; return JSON . stringify ( ret ) ; }
Import data on plugin init
@param args
@returns {Array}
Import data on plugin init