Giter Club home page Giter Club logo

Comments (5)

prantlf avatar prantlf commented on May 28, 2024

Yes, I'm afraid that you're right. You cannot decide, what time zone data will be used on the date-fns-timezone level.

Actually, I didn't expect, that the 2012-2022 data would be wanted so much :-) I didn't consider it important, because dates are entered in form fields im my application and it is impossible to predict how old date will be entered there. Hence always all time zones...

timezone-support is a bunch of functions and no object instance to initialize and send around. I will need to think something up, either some context object with the time zone data, or a global initialization.

from date-fns-timezone.

benkeen avatar benkeen commented on May 28, 2024

Very nice library, thanks! But yes, we have a similar problem: we need to use a custom timezone data bundle generated by timezone-support. Any suggestions on how to add this? I'd be happy to put in a PR.

from date-fns-timezone.

AndriiDidkivsky avatar AndriiDidkivsky commented on May 28, 2024

Any updates?

from date-fns-timezone.

erikt9 avatar erikt9 commented on May 28, 2024

If using webpack you can alias timezone-support to one of the limited data versions.

resolve: {
  alias: {
    'timezone-support$': path.resolve(
        __dirname,
        'node_modules/timezone-support/dist/index-1970-2038.js'
      )
  }
}

from date-fns-timezone.

sejoker avatar sejoker commented on May 28, 2024

with gatsby in gatsby-node.js:

const path = require('path');

exports.onCreateWebpackConfig = ({ actions }) => {
  actions.setWebpackConfig({
    resolve: {
      alias: {
        'timezone-support$': path.resolve(
          __dirname,
          'node_modules/timezone-support/dist/index-2012-2022.js'
        ),
      },
    },
  });
};

from date-fns-timezone.

Related Issues (16)

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.