Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ramirotw committed May 27, 2020
1 parent 11845be commit c5a67e1
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 @@ -60,11 +60,10 @@ export const timeLeft = (end): string => {
const minsDiff = differenceInMinutes(end_date, today)
const hoursDiff = differenceInHours(end_date, today)
const daysDiff = differenceInDays(end_date, today)
const weeksDiff = differenceInWeeks(end_date, today)
const monthsDiff = differenceInMonths(end_date, today)
const yearsDiff = differenceInYears(end_date, today)

if (yearsDiff > 0) return yearsDiff === 1 ? `${yearsDiff} year` : `${yearsDiff} year`
if (yearsDiff > 0) return yearsDiff === 1 ? `${yearsDiff} year` : `${yearsDiff} years`
if (monthsDiff > 0) return monthsDiff === 1 ? `${monthsDiff} month` : `${monthsDiff} months`
if (daysDiff > 0) return daysDiff === 1 ? `${daysDiff} day` : `${daysDiff} days`
if (hoursDiff > 0) return hoursDiff === 1 ? `${hoursDiff} hour` : `${hoursDiff} hours`
Expand Down

0 comments on commit c5a67e1

Please sign in to comment.