GithubHelp home page GithubHelp logo

Comments (7)

Khaoz-Topsy avatar Khaoz-Topsy commented on July 19, 2024

Great, another breaks in one browser and not the other 😂. I wonder if this is from me updating the dependencies or if it has been like this for a while 🤔

from communitymission-progress-viewer.

Lenni009 avatar Lenni009 commented on July 19, 2024

Why do we need that dayjs lib anyway? Can the native browser date API not do something this lib can?

from communitymission-progress-viewer.

Lenni009 avatar Lenni009 commented on July 19, 2024

There's also some invalid dates on Chrome, but there's more of them on Firefox.

If I know the requirements I could probably write up some code for time formatting which you could then implement here. Or maybe I can even fix the bug myself in the code, but I need to know what the expected format and the original purpose of this dayjs library is.

from communitymission-progress-viewer.

Khaoz-Topsy avatar Khaoz-Topsy commented on July 19, 2024

Interesting, I don't see any invalid dates in chrome
image

The date format (in the incident section) is dependent on whether or not there should be a time displayed. So either a long time (YYYY-MM-DD HH:mm) if the time is known or just a short date (YYYY-MM-DD) if it was a whole day issue. In other places the date format is different, just because of limited space 😅. I am pretty sure that I used dayJS just because I was lazy, looks like only the formatDate, addDays and dateIsBefore functions are used. So if you rewrite them (in the helper/dateHelper.ts file), then dayJS can easily be removed 😋

I think the bug comes from the .toLocaleString() method. I used it to represent the UTC date from the back-end into time that is in the user's timezone. Your system's date format is probably different to mine, which is probably slightly different between Chrome and Firefox 🤔

from communitymission-progress-viewer.

Lenni009 avatar Lenni009 commented on July 19, 2024

Maybe because our browsers are set to different languages. Testing this stuff is really hard, since it can work fine in one language, but break for another (like in this case, or for the UD22 website I made last year)
grafik

from communitymission-progress-viewer.

Khaoz-Topsy avatar Khaoz-Topsy commented on July 19, 2024

Yeah, I need to move away from parsing the dates 🤔. It was just so much easier to read than using the Date.UTC() 😅

from communitymission-progress-viewer.

Khaoz-Topsy avatar Khaoz-Topsy commented on July 19, 2024

And this is probably not helping 😂

image

from communitymission-progress-viewer.

Related Issues (1)

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.