3 ms·
Formatting dates with a format string is an anti-pattern. Format strings are too easy to get wrong and don't scale when you need to account for different locale
by robrichard 8y ago
Formatting dates with a format string is an anti-pattern. Format strings are too easy to get wrong and don't scale when you need to account for different locales. JavaScript's Intl functions do this correctly by providing an api that accepts a locale and options like weekday: narrow|short|long, year: numeric|2-digit, etc.