let start = '10:00'
let end = '18:00'
function getTimes(start, end, interval) {
const result = [];
const _start = moment(start, 'HH:mm');
const _end = moment(end, 'HH:mm');
if (_start > _end) {
_end.add(1, 'day');
}
while (_start <= _end) {
result.push(_start.format('HH:mm'));
_start.add(interval, 'minutes');
}
return result;
}
const times = getTimes('10:00', '18:00', 30);