Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Polyfill is not correctly handling timezone information for Daylight Savings Time for "cy" (Welsh) #5114

Copy link
Copy link
@Exigerr

Description

@Exigerr
Issue body actions

Which package?

@formatjs/intl-datetimeformat

Describe the bug

When using the @formatjs/intl-datetimeformat polyfill and loading the locale data for cy (Welsh), the timezone information does not correctly get displayed.

For a user in the Europe/London timezone, dates during the daylight savings period (Mar-Oct) will only show GMT as the timezone. The offset of +1 or BST will not be displayed.

Similarly if the "long" timeZoneName is provided it will output Amser Safonol Greenwich instead of Amser Haf Prydain (what appears in the CLDR json data for cy).

Looking at the generated locale-data which ships with @formatjs/intl-datetimeformat, the cy.js file lists the same content strings for DST times

      "Europe/London": {
        "long": [
          "Amser Safonol Greenwich",
          "Amser Safonol Greenwich"
        ],
        "short": [
          "GMT",
          "GMT"
        ]
      },

Worth noting, the times converted are correct, its just the timezone information which is wrong.

Generally the polyfills have saved me a world of pain in the past and allowed the use of the nicer Intl APIs. Unfortunately now I have some contracts with the teaching branch of the Welsh Government and must ensure they get the correct information.

Any assistance or quick bug-fix would be super appreciated <3

To Reproduce

Codesandbox URL

Codesandbox example of issue

Reproducible Steps/Repo

Simply load up the Codesandbox URL and view the output.

Alternatively:

  1. Import datetime polyfill + cy locale-data
import "@formatjs/intl-datetimeformat/polyfill-force";
import "@formatjs/intl-datetimeformat/add-all-tz.js";
import "@formatjs/intl-datetimeformat/locale-data/cy";
  1. Set default timezone to Europe/London
    Intl.DateTimeFormat.__setDefaultTimeZone("Europe/London");
  2. Display a date in the DST period with timezone information (short or long) in Welsh
new Intl.DateTimeFormat("cy", {
  day: "2-digit",
  month: "short",
  year: "numeric",
  hour: "numeric",
  minute: "2-digit",
  timeZoneName: "short",
}).format(new Date("2025-09-26T12:00:00Z"));
  1. Output will not have the correct GMT offset or long text.

Expected behavior

Given the language is set to cy, the user in the Europe/London timezone, and a date is in the DST period,

  • when using the "short" timeZoneName, either GMT+1 or BST should be output
  • when using the "long" timeZoneName, Amser Haf Prydain should be output (as per CLDR data)

It should mimic environments which don't need the polyfill (built-in Intl support for cy)

  • Firefox uses GMT+1
  • Safari uses GMT+1
  • NodeJs uses GMT+1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.