From 692058bbddbab92acccf2edf3f3e85c835db15b3 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sun, 4 Aug 2024 04:53:50 +0530 Subject: [PATCH] Fix time of day calculation logic Previously between 00:00 - 04:00 it'd trigger afternoon insteead of evening --- src/interface/web/app/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interface/web/app/page.tsx b/src/interface/web/app/page.tsx index 8fbaca47..afda3f9e 100644 --- a/src/interface/web/app/page.tsx +++ b/src/interface/web/app/page.tsx @@ -59,7 +59,7 @@ function ChatBodyData(props: ChatBodyDataProps) { // Get today's day const today = new Date(); const day = today.getDay(); - const timeOfDay = today.getHours() > 4 && today.getHours() < 12 ? 'morning' : today.getHours() < 17 ? 'afternoon' : 'evening'; + const timeOfDay = today.getHours() >= 17 || today.getHours() < 4 ? 'evening' : today.getHours() >= 12 ? 'afternoon' : 'morning'; const nameSuffix = props.userConfig?.given_name ? `, ${props.userConfig?.given_name}` : ""; const greetings = [ `What would you like to get done${nameSuffix}?`,