dynamic afternoon, morning, etc text

This commit is contained in:
Arjun Patel
2022-01-14 15:25:22 -08:00
parent dcc3633dca
commit 444c9e660c
2 changed files with 22 additions and 5 deletions
+15
View File
@@ -0,0 +1,15 @@
import moment from "moment";
export function generateGreetings(): string {
const hour = moment().hour();
if (hour > 16) {
return "Good evening";
}
if (hour > 11) {
return "Good afternoon";
}
return "Good morning";
}