Buat array 24 jam seperti 00:00 hingga 23:30
import moment from 'moment';
export const getTimesArray = () => {
const hours = Array.from({
length: 48
}, (_, hour) => moment({
hour: Math.floor(hour / 2),
minutes: (hour % 2 === 0 ? 0 : 30)
}).format('HH:mm')
);
return hours;
}
Powerful Pygmy