lib/cronTrigger.js
function decodeRangeTime(map, timeStr){
  let times = timeStr.split('-');

  times[0] = Number(times[0]);
  times[1] = Number(times[1]);
  if(times[0] > times[1]){
    console.log("Error time range");
    return null;
  }

  for(let i = times[0]; i <= times[1]; i++){
    map[i] = i;
  }
}
function decodeRangeTime(map, timeStr){
  let times = timeStr.split('-');

  times[0] = Number(times[0]);
  times[1] = Number(times[1]);
  if(times[0] > times[1]){
    console.log("Error time range");
    return null;
  }

  for(let i = times[0]; i <= times[1]; i++){
    map[i] = i;
  }
}
function decodeRangeTime ( map , timeStr ) { let times = timeStr . split ( '-' ) ; times [ 0 ] = Number ( times [ 0 ] ) ; times [ 1 ] = Number ( times [ 1 ] ) ; if ( times [ 0 ] > times [ 1 ] ) { console . log ( "Error time range" ) ; return null ; } for ( let i = times [ 0 ] ; i <= times [ 1 ] ; i ++ ) { map [ i ] = i ; } }
Decode time range
@param map The decode map
@param timeStr The range string, like 2-5
Decode time range