Giter VIP home page Giter VIP logo

ember-mu-transform-helpers's People

Contributors

claire-lovisa avatar ember-tomster avatar erikap avatar lordblendi avatar nvdk avatar windvis avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-mu-transform-helpers's Issues

Another possible serialization issue with the date transform

In #6 I switched from using UTC dates to local dates because it fixed some issues. It turns out that it might have created others though ๐Ÿ˜…, more specifically this potentially breaks UTC dates created in negative timezones.

For example, if you create a date instance like this:

new Date('2022-10-20') the browser will assume the date is an UTC date.

From the MDN docs:

Date-only strings (e.g. "1970-01-01") are treated as UTC, while date-time strings (e.g. "1970-01-01T12:00") are treated as local.

The time will still be set to 0, but for the UTC time. So it will be something like this in Belgian time: 2022-10-20T02:00:00+02:00. This will still serialize properly with the current implementation.

The problem is if you execute the code in a "negative" timezone. For example if you create the same UTC date in a -4 timezone it will serialize the previous date again: 2022-10-19T20:00:00-04:00 -> 2022-10-19.

So this PR wasn't really correct either, but I'm not sure what the real solution is at this point. I'm not smart enough for timezones ๐Ÿ˜ฌ.

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.