Skip to content

🐛 Issue: Incorrect timezone returned for Newfoundland #148

@khushi-c247

Description

@khushi-c247

Describe the bug

Description:
When selecting the Newfoundland timezone (UTC−03:30), the component correctly returns the IANA identifier (America/St_Johns) and offset, but the abbrev field is incorrect.

The abbreviation returned is "HNTN", which does not correspond to any valid or recognized timezone abbreviation for Newfoundland.

Expected Output
{
"value": "America/St_Johns",
"label": "(GMT-3:30) Newfoundland and Labrador",
"offset": -3.5,
"abbrev": "NST",
"altName": "Newfoundland Standard Time"
}

Actual Output
{
"value": "America/St_Johns",
"label": "(GMT-3:30) Newfoundland and Labrador",
"offset": -3.5,
"abbrev": "HNTN",
"altName": "Newfoundland Standard Time"
}

Steps to Reproduce

  1. Render the component.
  2. Select (GMT−3:30) Newfoundland and Labrador from the dropdown.
  3. Log the result from the onChange callback.
  4. Observe that abbrev returns "HNTN" instead of "NST".

Expected Behavior

  1. The abbrev field should return the correct abbreviation:
  2. "NST" for Newfoundland Standard Time
  3. "NDT" for Newfoundland Daylight Time (during DST)
  4. The rest of the object is correct (value, label, offset, altName).

Additional Context
This may be caused by an incorrect abbreviation mapping for timezones with fractional offsets (like -03:30). Newfoundland is unique in this respect, and the abbreviation should match IANA standards.

Image Image

Reproduction

import React, { useState } from "react"; import TimezoneSelect from "react-timezone-select"; export default function App() { const [tz, setTz] = useState({}); return ( <div style={{ padding: 20 }}>

React Timezone Select Test

{JSON.stringify(tz, null, 2)}
); }

System Info

**OS:** Ubuntu Linux 22.04

**Browser:** Chrome / Firefox (reproducible on both)

Used Package Manager

npm

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions