Skip to content

Commit

Permalink
fixes improper string interpolation in relative dates causing 'false'…
Browse files Browse the repository at this point in the history
… to be present when withoutSuffix is disabled (ohcnetwork#7189)

* fixes improper string interpolation in realtive dates causing 'false' to be present when withoutSuffix is disabled

* Update src/Utils/utils.ts

---------

Co-authored-by: Ashesh <[email protected]>
  • Loading branch information
rithviknishad and Ashesh3 authored Feb 7, 2024
1 parent 325547a commit faeb462
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ export const formatTime = (date: DateLike, format = TIME_FORMAT) =>

export const relativeDate = (date: DateLike, withoutSuffix = false) => {
const obj = dayjs(date);
return `${obj.fromNow(withoutSuffix)} ${
withoutSuffix && "ago"
return `${obj.fromNow(withoutSuffix)}${
withoutSuffix ? " ago " : ""
} at ${obj.format(TIME_FORMAT)}`;
};

Expand Down

0 comments on commit faeb462

Please sign in to comment.