mirror of
https://github.com/sheptikhinv/timers.git
synced 2026-02-07 07:41:36 +05:00
refactor some functions
This commit is contained in:
parent
981ef867fb
commit
8f69ed3b58
3 changed files with 19 additions and 15 deletions
12
src/helpers/Formatters.ts
Normal file
12
src/helpers/Formatters.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export const formatFullTime = (date: Date) => {
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||
return `${hours}:${minutes}:${seconds}`;
|
||||
};
|
||||
|
||||
export const formatTime = (date: Date) => {
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
return `${hours}:${minutes}`;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue