Skip to content

Instantly share code, notes, and snippets.

@RamyaRaoGC
RamyaRaoGC / i18n-time-intervals.js
Created May 5, 2022 01:36 — forked from indexzero/i18n-time-intervals.js
Generate a 24 hour range of 30-minute time intervals that are i18n compatible
let items = [];
for (var hour = 0; hour < 24; hour++) {
items.push([hour, 0]);
items.push([hour, 30]);
}
const date = new Date();
const formatter = new Intl.DateTimeFormat('en-US', {
hour: 'numeric',
minute: 'numeric',