Skip to content

Commit

Permalink
remove seconds from countdown
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceau committed Feb 14, 2024
1 parent 6162c52 commit b06705d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/renderer/pages/home/sidebar/slippi_store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const SlippiStore = React.memo(function SlippiStore() {

React.useEffect(() => {
const endDate = SHOP_CLOSES_AT;
const interval = setInterval(() => {
const checkTime = () => {
const now = new Date();
const duration = intervalToDuration({ start: now, end: endDate });

Expand All @@ -89,10 +89,12 @@ export const SlippiStore = React.memo(function SlippiStore() {
setCountdown("");
clearInterval(interval);
} else {
setCountdown(formatDuration(duration, { locale: shortEnLocale }));
setCountdown(formatDuration(duration, { format: ["days", "hours", "minutes"], locale: shortEnLocale }));
}
}, 1000);
};
checkTime();

const interval = setInterval(checkTime, 60 * 1000);
return () => clearInterval(interval);
}, []);

Expand Down

0 comments on commit b06705d

Please sign in to comment.