根据时间段获取时间轴数组
/** * * 只精确到分钟,精确到秒可以自行添加 * @param {any} start 开始时间 (例 9:30) * @param {any} end 结束时间 (例 15:00) * @returns */ function autoTimeline(start, end) { var timeline = [], startHour = start.split(':')[0] * 1, startMin = start.split(':')[1] * 1, endHour = end.split(':')[0] * 1, endMin = end.split(':')[1] * 1; for (var i = startHour; i <= endHour; i++) { var start = (i == startHour) ? startMin : '0'; var end = (i == endHour) ? endMin : '59'; for (var j = start; j <= end; j++) { j = (j < 10) ? '0' + j : j; timeline.push(i + ":" + j); } } return timeline; }