templates/validation-function/time-module.js
function extractIso8601TimePieces(value) {
    var timePieces = /^(\d{2}):(\d{2})(?:\:(\d{2}))?(?:\.(\d{1,3}))?$/.exec(value);
    if (timePieces === null) {
      return null;
    }

    var hour = timePieces[1] ? parseInt(timePieces[1], 10) : 0;
    var minute = timePieces[2] ? parseInt(timePieces[2], 10) : 0;
    var second = timePieces[3] ? parseInt(timePieces[3], 10) : 0;

    // The millisecond component has a variable length; normalize the length by padding it with zeros
    var millisecond = timePieces[4] ? parseInt(utils.padRight(timePieces[4], 3, '0'), 10) : 0;

    return [ hour, minute, second, millisecond ];
  }
function extractIso8601TimePieces(value) {
    var timePieces = /^(\d{2}):(\d{2})(?:\:(\d{2}))?(?:\.(\d{1,3}))?$/.exec(value);
    if (timePieces === null) {
      return null;
    }

    var hour = timePieces[1] ? parseInt(timePieces[1], 10) : 0;
    var minute = timePieces[2] ? parseInt(timePieces[2], 10) : 0;
    var second = timePieces[3] ? parseInt(timePieces[3], 10) : 0;

    // The millisecond component has a variable length; normalize the length by padding it with zeros
    var millisecond = timePieces[4] ? parseInt(utils.padRight(timePieces[4], 3, '0'), 10) : 0;

    return [ hour, minute, second, millisecond ];
  }
function extractIso8601TimePieces ( value ) { var timePieces = / ^(\d{2}):(\d{2})(?:\:(\d{2}))?(?:\.(\d{1,3}))?$ / . exec ( value ) ; if ( timePieces === null ) { return null ; } var hour = timePieces [ 1 ] ? parseInt ( timePieces [ 1 ] , 10 ) : 0 ; var minute = timePieces [ 2 ] ? parseInt ( timePieces [ 2 ] , 10 ) : 0 ; var second = timePieces [ 3 ] ? parseInt ( timePieces [ 3 ] , 10 ) : 0 ; // The millisecond component has a variable length; normalize the length by padding it with zeros var millisecond = timePieces [ 4 ] ? parseInt ( utils . padRight ( timePieces [ 4 ] , 3 , '0' ) , 10 ) : 0 ; return [ hour , minute , second , millisecond ] ; }
Converts an ISO 8601 time into an array of its component pieces
Converts an ISO 8601 time into an array of its component pieces