forgejo-federation/web_src/js/utils
Kemal Zebari 16eb85adfb
Have time.js use UTC-related getters/setters (#30857)
Before this patch, we were using `Date` getter/setter methods that
worked with local time to get a list of Sundays that are in the range of
some start date and end date. The problem with this was that the Sundays
are in Unix epoch time and when we changed the "startDate" argument that
was passed to make sure it is on a Sunday, this change would be
reflected when we convert it to Unix epoch time. More specifically, I
observed that we may get different Unix epochs depending on your
timezone when the returned list should rather be timezone-agnostic.

This led to issues in US timezones that caused the contributor, code
frequency, and recent commit charts to not show any chart data. This fix
resolves this by using getter/setter methods that work with UTC since it
isn't dependent on timezones.

Fixes #30851.

---------

Co-authored-by: Sam Fisher <fisher@3echelon.local>
(cherry picked from commit 22c7b3a74459833b86783e84d4708c8934d34e58)
2024-05-12 20:03:09 +02:00
..
color.js [PORT] gitea##30237: Fix and rewrite contrast color calculation, fix project-related bugs 2024-04-15 16:11:34 +02:00
color.test.js [PORT] gitea##30237: Fix and rewrite contrast color calculation, fix project-related bugs 2024-04-15 16:11:34 +02:00
dom.js Refactor and fix archive link bug (#30535) 2024-05-10 09:20:12 +02:00
image.js Downscale pasted PNG images based on metadata (#29123) 2024-02-19 22:58:33 +01:00
image.test.js Downscale pasted PNG images based on metadata (#29123) 2024-02-19 22:58:33 +01:00
match.js Avoiding accessing undefined mentionValues (#26461) 2023-08-12 08:36:23 +00:00
match.test.js Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
time.js Have time.js use UTC-related getters/setters (#30857) 2024-05-12 20:03:09 +02:00
time.test.js Implement contributors graph (#27882) 2024-02-17 23:24:31 +01:00
url.js Support pasting URLs over markdown text (#29566) 2024-03-11 23:36:59 +07:00
url.test.js Support pasting URLs over markdown text (#29566) 2024-03-11 23:36:59 +07:00