Display timestamps using the timezone that is stored at the activity (relative date in timeline views)

This commit is contained in:
Niklas Deutschmann 2026-04-12 09:21:11 +02:00
parent 0625b5c0df
commit a9249dded4
2 changed files with 3 additions and 2 deletions

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);