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, formatDistance,
formatPace, formatPace,
formatDateTimeWithTimezone, formatDateTimeWithTimezone,
formatDateWithTimezone formatDateWithTimezone,
ensureUTC
}; };

View file

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