セレクトボックスで頑張る人向け
突貫メソッド2つ
1 ~ 31 の配列作成 [1, 2, 3,...31]
31days
const arrayDays = () => {
const days = [];
for (let i = 1; i <= 31; i += 1) {
days.push(i);
}
return days;
};
00:00 ~ 23:00 の配列作成 [00:00, 01:00, 02:00,...23:00]
24times
const arrayTimes = () => {
const times = [];
for (let i = 0; i <= 23; i += 1) {
times.push(`${i.toString().padStart(2, '0')}:00`);
}
return times;
};