Skip to content

Commit

Permalink
Bug 1739225: Timestamp component always shows dates in the future as …
Browse files Browse the repository at this point in the history
…relative dates
  • Loading branch information
dtaylor113 committed Aug 14, 2019
1 parent b0c62e3 commit 2d3af1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/public/components/utils/timestamp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ const timestampFor = (mdate: Date, now: Date, omitSuffix: boolean) => {
return '-';
}

const timeAgo = now.getTime() - mdate.getTime();
const timeFromNow = Math.abs(now.getTime() - mdate.getTime());
if (omitSuffix) {
return dateTime.fromNow(mdate, undefined, {omitSuffix: true});
}
if (timeAgo < 630000) { // 10.5 minutes
if (timeFromNow < 630000) { // 10.5 minutes
return dateTime.fromNow(mdate);
}

Expand Down

0 comments on commit 2d3af1a

Please sign in to comment.