Git Product home page Git Product logo

Comments (13)

dmfilipenko avatar dmfilipenko commented on May 23, 2024

@BehindTheMath fell free to make pull request

from timezones.json.

manojeltropy avatar manojeltropy commented on May 23, 2024

PST is "pacific standard time" but here it says "pakistan standard Time"

from timezones.json.

hexadecy avatar hexadecy commented on May 23, 2024

When isdst=true, abbr and offset follow.
In my use case, I only use Text and utc[0] = "America/Detroit".
I use the TZ database to do the rest.

from timezones.json.

hexadecy avatar hexadecy commented on May 23, 2024

pakistan standard Time should be PKT

from timezones.json.

hexadecy avatar hexadecy commented on May 23, 2024

I think it should have been abbr_dst and offset_dst.
But this is a breaking change.

from timezones.json.

BehindTheMath avatar BehindTheMath commented on May 23, 2024

@dmfilipenko How about if we would change the format to something like this:

interface TimezoneDetails {
  value: string;
  abbr: string;
  offset: number;
  text: string;
}
export interface Timezone extends TimezoneDetails {
  dst: TimezoneDetails | false | null;
  utc: string[];
}

Here's an example of what it would look like:

  {
    "value": "Eastern Standard Time",
    "abbr": "EST",
    "offset": -5,
    "text": "(UTC-05:00) Eastern Time (US & Canada)",
    "dst": {
      "value": "Eastern Daylight Time",
      "abbr": "EDT",
      "offset": -4,
      "text": "(UTC-04:00) Eastern Time (US & Canada)",
    },
    "utc": [
      "America/Detroit",
      "America/Havana",
      "America/Indiana/Petersburg",
      "America/Indiana/Vincennes",
      "America/Indiana/Winamac",
      "America/Iqaluit",
      "America/Kentucky/Monticello",
      "America/Louisville",
      "America/Montreal",
      "America/Nassau",
      "America/New_York",
      "America/Nipigon",
      "America/Pangnirtung",
      "America/Port-au-Prince",
      "America/Thunder_Bay",
      "America/Toronto",
      "EST5EDT",
    ],
  },
  {
    "value": "Venezuela Standard Time",
    "abbr": "VST",
    "offset": -4.5,
    "text": "(UTC-04:30) Caracas",
    "dst": false,
    "utc": [
      "America/Caracas",
    ],
  },

The value, abbr, offset, and text properties would be in the root object for standard time, and again as properties of the dst property if applicable.

This would be a breaking change, and would require a major version bump.

from timezones.json.

dmfilipenko avatar dmfilipenko commented on May 23, 2024

@BehindTheMath This is a huge change. Unfortunately, I don't have much time to do this

from timezones.json.

BehindTheMath avatar BehindTheMath commented on May 23, 2024

I might do it myself and submit a PR.

What do you think of such a schema?

from timezones.json.

dmfilipenko avatar dmfilipenko commented on May 23, 2024

@BehindTheMath from a first view it might be useful. But what if we wouldn't make a nested object and add another timezone

{
 	"value": "Eastern Daylight Time",
    "abbr": "EDT",
    "offset": -4,
    "dst": true,
    "text": "(UTC-04:00) Eastern Time (US & Canada)",
    ...
},
{
	"value": "Eastern Standard Time",
    "abbr": "EST",
    "offset": -5,
    "text": "(UTC-05:00) Eastern Time (US & Canada)",
	"dst": false,
	...
}

I prefer to left this structure a flat

from timezones.json.

BehindTheMath avatar BehindTheMath commented on May 23, 2024

@dmfilipenko My issue with that way is that there's no relationship between standard and daylight timezones. So if I have one, there's no easy way to get the other.

from timezones.json.

dmfilipenko avatar dmfilipenko commented on May 23, 2024

@BehindTheMath I was thinking about and seemed like it is reasonable. Lets try to do this

from timezones.json.

mikeyyyzhao avatar mikeyyyzhao commented on May 23, 2024

@BehindTheMath any progress on this? This is so close to what we need

from timezones.json.

BehindTheMath avatar BehindTheMath commented on May 23, 2024

I kind of gave up on it and started using Luxon instead.

from timezones.json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.