mirror of
https://github.com/ztjhz/BetterChatGPT.git
synced 2023-07-20 23:11:29 +03:00
refactor: getToday (#281)
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
export const getToday = () => {
|
||||
const date = new Date();
|
||||
const dateString =
|
||||
date.getFullYear() +
|
||||
'-' +
|
||||
('0' + (date.getMonth() + 1)).slice(-2) +
|
||||
'-' +
|
||||
('0' + date.getDate()).slice(-2);
|
||||
return dateString;
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
|
||||
return `${year}-${month}-${day}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user