-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
Which package?
intl-datetimeformat
Describe the bug
When using the polyfill for the date time format and en-GB locale data, the date formatting seems to be incorrect. Rather than format "d/MMM/y" it results in a format "d MMM y". This is not consistent with the non polyfilled behavior.
To Reproduce
Steps to reproduce the behavior:
Minimal example:
require('@formatjs/intl-datetimeformat/polyfill');
require('@formatjs/intl-datetimeformat/locale-data/en-GB');
const formatter = new Intl.DateTimeFormat('en-GB');
const result = formatter.format(new Date());
console.log(result); // prints: "12 8 2020", expected value: "12/8/2020" or "12/08/2020"
Expected behavior
I expect the date to be of format "d/MMM/y": forward slash as a separator sign, rather than a space.
e.g in Chrome (no polyfill):

Additional context
Failing test: https://travis-ci.org/github/Sensorfactdev/i18n/builds/716981838
The issue is resolved when manually updating the en-GB locale data file: update the first occurence of "d MMM y" to "d/MMM/y".
Reactions are currently unavailable