Skip to content

Commit

Permalink
fix: split code to minimize
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamyplayer committed Oct 10, 2022
1 parent d8d61b7 commit 9bde195
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 38 deletions.
38 changes: 0 additions & 38 deletions utils/functions.js

This file was deleted.

11 changes: 11 additions & 0 deletions utils/funtions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const wait = milliseconds => new Promise(resolve => setTimeout(resolve, milliseconds));

export const compactMode = ({ date, formatType = 'Date' }) => {
return formatType === 'Date'
? Intl.DateTimeFormat('en', { dateStyle: 'medium', timeStyle: 'short' }).format(date)
: Intl.NumberFormat('en').format(date);
};

export const getRandomInt = (min = 1, max = 15) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
};

0 comments on commit 9bde195

Please sign in to comment.