1.5.0 • Published 5 months ago

@sytexa/tzdb-revised v1.5.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Important

This package slightly extends / modifies @vvo/tzdb for our specific use case.

You probably want the original version by VVO:

All credit to the original author VVO

Changes

Deprecated time zone names are moved to their own key in the time zone object, instead of grouping them with group:

{
  name: "America/New_York",
  alternativeName: "Eastern Time",
  group: [
    "America/Detroit",
    "America/Indiana/Indianapolis",
    "America/Indiana/Marengo",
    "America/Indiana/Petersburg",
    "America/Indiana/Vevay",
    "America/Indiana/Vincennes",
    "America/Indiana/Winamac",
    "America/Kentucky/Louisville",
    "America/Kentucky/Monticello",
    "America/New_York"
  ],
  deprecatedNames: [
    "US/Michigan",
    "America/Fort_Wayne",
    "America/Indianapolis",
    "US/East-Indiana",
    "America/Louisville",
    "US/Eastern"
  ],
  continentCode: "NA",
  continentName: "North America",
  countryName: "United States",
  countryCode: "US",
  mainCities: ["New York City", "Brooklyn", "Queens", "Philadelphia"],
  rawOffsetInMinutes: -300,
  abbreviation: "EST",
  rawFormat: "-05:00 Eastern Time - New York City, Brooklyn, Queens, Philadelphia"
}

Useful if you don't want or need to support the deprecated time zones...

getUngroupedTimeZones()

This package also adds the getUngroupedTimeZones() function, which returns an array of simplified time zone objects with current time information. We prefer this for creating time zone selection boxes when deprecated time zones are not required.

[
  // ...
  {
    name: "America/Los_Angeles",
    currentTimeOffsetInMinutes: -420, // "current" time zone offset, this is why getUngroupedTimeZones() is a method and not just an object: it works at runtime
    currentTimeFormat: "(UTC -7) America/Los Angeles",
  },
  // ...
];

tzdb GitHub license Tests

1.5.0

5 months ago

1.4.0

1 year ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago