Moved get date today to separate component

This commit is contained in:
Keannu Christian Bernasol 2023-03-10 23:52:20 +08:00
parent 9f0bbd7a66
commit 7dc3729bec
2 changed files with 13 additions and 12 deletions

View file

@ -0,0 +1,11 @@
export default function GetToday() {
const current = new Date();
const date =
("0" + (current.getMonth() + 1)).slice(-2) +
"-" +
("0" + current.getDate()).slice(-2) +
"-" +
current.getFullYear();
console.log("Today is " + date);
return date;
}