Code Monkey home page Code Monkey logo

Comments (4)

sebbo2002 avatar sebbo2002 commented on August 26, 2024 2

As long as using UTC datetimes works in nearly every client I would stick to this solution, because it's not possible to detect the end users location and timezone right now.

Did you have any issues with UTC dates?

from ical-generator.

takkaria avatar takkaria commented on August 26, 2024

Yeah, at the moment timezone support is fudged a bit (I wrote this bit). Using UTC is obviously not correct, but neither is using the local time set on the Date object, because the timezone being output in the ical file will not necessarily be the machine's local date, and JS Date objects can only be either UTC or local time. It seemed to be more straightforward and predictable to use UTC dates in this case.

I think the solution would be to pull in moment-timezone as a dependency for proper timezone handling. I started sketching this out at on #38 but maybe I should finish it off.

from ical-generator.

ocelotsloth avatar ocelotsloth commented on August 26, 2024

+1 to using moment-timezone. It's what I'm using in srct/schedules and it's a bit hard to follow what happens to the timezones and the times themselves between going into and out ical-generator.

from ical-generator.

sebbo2002 avatar sebbo2002 commented on August 26, 2024

ical-generator 3.0 now uses moment-timezone, so this issue should be fixed. You can test the current develop with npm i ical-generator@next.

from ical-generator.

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.