mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 05:39:12 +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:
@@ -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}?`,
|
||||||
|
|||||||
Reference in New Issue
Block a user