feat: add current date to omo-env context

This commit is contained in:
Bo Li 2026-01-20 08:18:45 +08:00
parent 4f7ce87e66
commit 193c176130
No known key found for this signature in database

View File

@ -99,7 +99,14 @@ export function createEnvContext(): string {
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
const locale = Intl.DateTimeFormat().resolvedOptions().locale
const timeStr = now.toLocaleTimeString("en-US", {
const dateStr = now.toLocaleDateString(locale, {
weekday: "short",
year: "numeric",
month: "short",
day: "numeric",
})
const timeStr = now.toLocaleTimeString(locale, {
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
@ -108,6 +115,7 @@ export function createEnvContext(): string {
return `
<omo-env>
Current date: ${dateStr}
Current time: ${timeStr}
Timezone: ${timezone}
Locale: ${locale}