mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Fix time of day calculation logic
Previously between 00:00 - 04:00 it'd trigger afternoon insteead of evening
This commit is contained in:
parent
015c155582
commit
692058bbdd
1 changed files with 1 additions and 1 deletions
|
@ -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}?`,
|
||||
|
|
Loading…
Reference in a new issue