dist/jquery.schedule.js
function (time) {
      var split = time.split(':');
      var hour = parseInt(split[0]);
      var mn = parseInt(split[1]);

      if (this.settings.hour === 12) {
        var matches = time.match(/([0-1]?[0-9]):?([0-5][0-9])?\s?(am|pm|p)?/);
        var ind = matches[3];
        if (!ind) {
          ind = 'am';
        }

        hour = parseInt(matches[1]);
        mn = parseInt(matches[2]);

        if (!mn) {
          mn = 0;
        }

        if (hour === 12 && ind === 'am') {
          hour = 0;
        }
        if (hour === 12 && (ind === 'pm' || ind === 'p')) {
          ind = 'am';
        }
        if (ind === 'pm' || ind === 'p') {
          hour += 12;
        }
      }

      var position = 0;
      position += hour * this.periodInterval;
      position += mn / 60 * this.periodInterval;

      if (Math.floor(position) !== position) {
        return -1;
      }

      return position;
    }
function (time) {
      var split = time.split(':');
      var hour = parseInt(split[0]);
      var mn = parseInt(split[1]);

      if (this.settings.hour === 12) {
        var matches = time.match(/([0-1]?[0-9]):?([0-5][0-9])?\s?(am|pm|p)?/);
        var ind = matches[3];
        if (!ind) {
          ind = 'am';
        }

        hour = parseInt(matches[1]);
        mn = parseInt(matches[2]);

        if (!mn) {
          mn = 0;
        }

        if (hour === 12 && ind === 'am') {
          hour = 0;
        }
        if (hour === 12 && (ind === 'pm' || ind === 'p')) {
          ind = 'am';
        }
        if (ind === 'pm' || ind === 'p') {
          hour += 12;
        }
      }

      var position = 0;
      position += hour * this.periodInterval;
      position += mn / 60 * this.periodInterval;

      if (Math.floor(position) !== position) {
        return -1;
      }

      return position;
    }
function ( time ) { var split = time . split ( ':' ) ; var hour = parseInt ( split [ 0 ] ) ; var mn = parseInt ( split [ 1 ] ) ; if ( this . settings . hour === 12 ) { var matches = time . match ( / ([0-1]?[0-9]):?([0-5][0-9])?\s?(am|pm|p)? / ) ; var ind = matches [ 3 ] ; if ( ! ind ) { ind = 'am' ; } hour = parseInt ( matches [ 1 ] ) ; mn = parseInt ( matches [ 2 ] ) ; if ( ! mn ) { mn = 0 ; } if ( hour === 12 && ind === 'am' ) { hour = 0 ; } if ( hour === 12 && ( ind === 'pm' || ind === 'p' ) ) { ind = 'am' ; } if ( ind === 'pm' || ind === 'p' ) { hour += 12 ; } } var position = 0 ; position += hour * this . periodInterval ; position += mn / 60 * this . periodInterval ; if ( Math . floor ( position ) !== position ) { return - 1 ; } return position ; }
Return a position from a readable hour
@param time
@returns {number}
Return a position from a readable hour