Utwórz 24 -godzinne tablice, takie jak 00:00 do 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