-
Notifications
You must be signed in to change notification settings - Fork 49
Description
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
- Render the component.
- Select (GMT−3:30) Newfoundland and Labrador from the dropdown.
- Log the result from the onChange callback.
- Observe that abbrev returns "HNTN" instead of "NST".
Expected Behavior
- The abbrev field should return the correct abbreviation:
- "NST" for Newfoundland Standard Time
- "NDT" for Newfoundland Daylight Time (during DST)
- 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.
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.