GithubHelp home page GithubHelp logo

Comments (7)

ecmadao avatar ecmadao commented on June 14, 2024

@jaynakus
Thanks for your feedback! I'll check it later.

from react-times.

jirikolarik avatar jirikolarik commented on June 14, 2024

Doesn't work on Chrome either in Europe.

moment.tz.guess() is using Intl.DateTimeFormat().resolvedOptions().timeZone which returns CET and getTzForName("CET") returns undefined

from react-times.

gnilk avatar gnilk commented on June 14, 2024

I added this in my local branch to getTzForName. Does solve the problem but I have no clue if it's a fix. Basically searching the abbreviation as well as the zone name if the first fail.

  if (maps.length == 0) {
    maps = tzMaps.filter(function(tzMap) {
      return tzMap['zoneAbbr'] === name;
    })
  }

full function now looks like:

var getTzForName = function getTzForName(name) {
  var maps = tzMaps.filter(function (tzMap) {
    return tzMap['zoneName'] === name;
  });
  if (maps.length == 0) {
    maps = tzMaps.filter(function(tzMap) {
      return tzMap['zoneAbbr'] === name;
    })
  }
  return (0, _func.head)(maps);
};

from react-times.

ecmadao avatar ecmadao commented on June 14, 2024

Sorry guys, I'm taking a vacation these days and just see your comments. First of all, many thanks for your feedback! But it really works well for me, so I have to do more debug to check, and maybe use @gnilk 's solution to publish a small bugfix version to check if it help.

from react-times.

ecmadao avatar ecmadao commented on June 14, 2024

Publish a new version V2.2.2, using your @gnilk solution, thanks. Your can update and check if it works.

from react-times.

gnilk avatar gnilk commented on June 14, 2024

Seems to work. Thanks!

from react-times.

JensC avatar JensC commented on June 14, 2024

I am using a version 2.2.10 and I still have the problem mentioned above. Does the version 2.2.10 support predefined property "timezone" and would that inhibit the error? Unfortunately I do not have a Windows 10 at hand and I am stuck using this older version of react-times.

from react-times.

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.