Fix division by 0
This was causing Safari to scream, but unsure why Chrome was fine
This commit is contained in:
parent
8d0860893e
commit
f7bc57ee5f
1 changed files with 1 additions and 1 deletions
|
|
@ -13,7 +13,7 @@ export function formatTimeAgo(date: Date, locale: string = 'en-us') {
|
||||||
|
|
||||||
let duration = (date.getTime() - new Date().getTime()) / 1000
|
let duration = (date.getTime() - new Date().getTime()) / 1000
|
||||||
|
|
||||||
for (let i = 0; i <= DIVISIONS.length; i++) {
|
for (let i = 0; i < DIVISIONS.length; i++) {
|
||||||
const division = DIVISIONS[i]
|
const division = DIVISIONS[i]
|
||||||
|
|
||||||
if (Math.abs(duration) < division.amount) {
|
if (Math.abs(duration) < division.amount) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue