Skip to content

Commit

Permalink
reformat code time.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
leonthuongto committed May 31, 2024
1 parent e76896c commit 33a46cf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/utils/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,17 @@ export const toUnixTimeSeconds = (date: Date): number => {
export const displayRemainingTime = (remainingDays: number, remainingHours: number): string => {
// Handle days first
if (remainingDays > 1) {
return `${remainingDays} Days`;
return `${remainingDays} Days`
} else if (remainingDays === 1) {
return '1 Day';
return '1 Day'
}

// If days are less than 1, handle hours
if (remainingHours < 1) {
return remainingHours === 0 ? '0 Hour' : 'Less than 1 Hour';
return remainingHours === 0 ? '0 Hour' : 'Less than 1 Hour'
} else if (remainingHours === 1) {
return '1 Hour';
return '1 Hour'
} else {
return `${remainingHours} Hours`;
return `${remainingHours} Hours`
}
};
}

0 comments on commit 33a46cf

Please sign in to comment.