mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-21 12:29:36 +02:00
Added auto-refresh for greeting and date. Fixed multiple React warnings
This commit is contained in:
parent
d257fbf9a3
commit
f137498e7e
16 changed files with 121 additions and 59 deletions
8
client/src/components/Home/functions/dateTime.ts
Normal file
8
client/src/components/Home/functions/dateTime.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
export const dateTime = (): string => {
|
||||
const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
||||
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
||||
|
||||
const now = new Date();
|
||||
|
||||
return `${days[now.getDay()]}, ${now.getDate()} ${months[now.getMonth()]} ${now.getFullYear()}`;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue