Skip to content

Commit

Permalink
Merge pull request #50638 from software-mansion-labs/@zfurtak/fix-tim…
Browse files Browse the repository at this point in the history
…ezone

Fix displaying relative time of the Xero last sync
  • Loading branch information
puneetlath authored Oct 14, 2024
2 parents 8ab4792 + 4af9242 commit 7c9b52a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/DateUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
endOfMonth,
endOfWeek,
format,
formatDistanceToNow,
formatDistance,
getDate,
getDay,
isAfter,
Expand Down Expand Up @@ -249,7 +249,8 @@ function datetimeToCalendarTime(locale: Locale, datetime: string, includeTimeZon
*/
function datetimeToRelative(locale: Locale, datetime: string): string {
const date = getLocalDateFromDatetime(locale, datetime);
return formatDistanceToNow(date, {addSuffix: true, locale: locale === CONST.LOCALES.EN ? enGB : es});
const now = getLocalDateFromDatetime(locale);
return formatDistance(date, now, {addSuffix: true, locale: locale === CONST.LOCALES.EN ? enGB : es});
}

/**
Expand Down

0 comments on commit 7c9b52a

Please sign in to comment.