mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00: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
|
// Get today's day
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const day = today.getDay();
|
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 nameSuffix = props.userConfig?.given_name ? `, ${props.userConfig?.given_name}` : "";
|
||||||
const greetings = [
|
const greetings = [
|
||||||
`What would you like to get done${nameSuffix}?`,
|
`What would you like to get done${nameSuffix}?`,
|
||||||
|
|
Loading…
Add table
Reference in a new issue