w3champions / website

The webpage for the www.w3champions.com community project.
47 stars 54 forks source link

Migrate from `moment` to `date-fns` #627

Closed Rotzbua closed 1 year ago

Rotzbua commented 1 year ago

Changes

Bugs

Reference

First part of the solution for #621

gustav87 commented 1 year ago

The MMR/RP data is on the wrong dates on the player MMR timeline chart because of the UTC conversion to local timezone. Is that fixed when we use a newer version of chartjs, or could we address it now?

Rotzbua commented 1 year ago

should be solved with https://github.com/w3champions/website/pull/628/commits/b93f29a984d4597697b64c291375e654faf40699

edit: reordered and rebased into this pr

gustav87 commented 1 year ago

For some reason, chartjs still puts the wrong dates on the x-axis. The data is on the correct dates now, though, so that's good. image

Rotzbua commented 1 year ago

Thanks for pointing out the problem 👍

For some reason, chartjs still puts the wrong dates on the x-axis

Unfortunately the x-axis is right. The chart starts with Jan 24, 2023, 11:44pm but is not labeled because the next tick is just 16 minutes later and for readability reasons the first x-axis-label is Jan 25. 🔍

Of course that is not the intended behavour. The reason is that before only a string with the date was provided. Now a Date object is used. To get the same result the Date has to be set to the start of the day.

gustav87 commented 1 year ago

Awesome work, man. Merging!