Display activity date in local time (using the time zone that is stored with the activity), not in UTC #4

Merged
kabupatix merged 3 commits from 2-local-time-zone-support into main 2026-04-27 22:01:09 +02:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit a9249dded4 - Show all commits

View file

@ -493,5 +493,6 @@ window.FitPub = {
formatDistance,
formatPace,
formatDateTimeWithTimezone,
formatDateWithTimezone
formatDateWithTimezone,
ensureUTC
};

View file

@ -727,7 +727,7 @@ const FitPubTimeline = {
* @returns {string} Time ago string
*/
formatTimeAgo: function(timestamp) {
const date = new Date(timestamp);
const date = new Date(FitPub.ensureUTC(timestamp));
const now = new Date();
const secondsAgo = Math.floor((now - date) / 1000);