Does Intl.DateTimeFormat care about ‘2-digit’ or ‘numeric’?
I want to use IntlDateTimeFormat to provide leading zeros. My code is: const timeFormatter = Intl.DateTimeFormat(undefined,{minute: '2-digit'}); const date = new Date(); date.setMinutes(4); console.log(timeFormatter.format(date)); // PRINTS: 4 and not 04 However, when I add second: '2-digit' to the options object.…