Skip to content

Commit

Permalink
πŸ› [docs/bugs] hopefully fix random docs build error
Browse files Browse the repository at this point in the history
  • Loading branch information
jxn-30 committed Jan 4, 2023
1 parent f997e3b commit b264586
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/.vuepress/components/bug-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ const rtf = new Intl.RelativeTimeFormat('en', {
const getRelativeTime = (d1, d2 = new Date()) => {
const elapsed = d1.getTime() - d2.getTime();
// "Math.abs" accounts for both "past" & "future" scenarios
for (const unit in units) {
// "Math.abs" accounts for both "past" & "future" scenarios
if (Math.abs(elapsed) > units[unit] || unit === 'second')
return rtf.format(Math.round(elapsed / units[unit]), unit);
return rtf.format(Math.round(elapsed / units[unit]) || 0, unit);
}
return elapsed.toLocaleString();
};
Expand Down

0 comments on commit b264586

Please sign in to comment.