mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-19 19:49:37 +02:00
12 lines
308 B
TypeScript
12 lines
308 B
TypeScript
|
export const greeter = (): string => {
|
||
|
const now = new Date().getHours();
|
||
|
let msg: string;
|
||
|
|
||
|
if (now >= 18) msg = 'Good evening!';
|
||
|
else if (now >= 12) msg = 'Good afternoon!';
|
||
|
else if (now >= 6) msg = 'Good morning!';
|
||
|
else if (now >= 0) msg = 'Good night!';
|
||
|
else msg = 'Hello!';
|
||
|
|
||
|
return msg;
|
||
|
}
|