Skip to content

Commit

Permalink
Fix wrong number of days in time left formula
Browse files Browse the repository at this point in the history
  • Loading branch information
leolower committed May 25, 2020
1 parent 1c32269 commit 11845be
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ export const timeLeft = (end): string => {

if (yearsDiff > 0) return yearsDiff === 1 ? `${yearsDiff} year` : `${yearsDiff} year`
if (monthsDiff > 0) return monthsDiff === 1 ? `${monthsDiff} month` : `${monthsDiff} months`
if (weeksDiff > 0) return weeksDiff === 1 ? `${daysDiff} week` : `${daysDiff} week`
if (daysDiff > 0) return daysDiff === 1 ? `${daysDiff} day` : `${daysDiff} days`
if (hoursDiff > 0) return hoursDiff === 1 ? `${daysDiff} hour` : `${hoursDiff} hours`
if (hoursDiff > 0) return hoursDiff === 1 ? `${hoursDiff} hour` : `${hoursDiff} hours`
return minsDiff === 1 ? `${minsDiff} minute` : `${minsDiff} minutes`
}

Expand Down

0 comments on commit 11845be

Please sign in to comment.