mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 19:24:00 +01:00
refactor: getToday
(#281)
This commit is contained in:
parent
6a56dd0231
commit
f752a4420e
|
@ -1,10 +1,8 @@
|
||||||
export const getToday = () => {
|
export const getToday = () => {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
const dateString =
|
const year = date.getFullYear();
|
||||||
date.getFullYear() +
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
'-' +
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
('0' + (date.getMonth() + 1)).slice(-2) +
|
|
||||||
'-' +
|
return `${year}-${month}-${day}`;
|
||||||
('0' + date.getDate()).slice(-2);
|
|
||||||
return dateString;
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue