mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
fix(session-ui): show the current day in the message menu timestamp (#65081)
This commit is contained in:
committed by
GitHub
Unverified
parent
8c08e834c8
commit
906e370146
@@ -313,7 +313,8 @@ export function CurrentUserMessageDisplay(props: {
|
||||
})
|
||||
|
||||
// The menu names the day relatively: Today and Yesterday, then the date this year, then the date with its year.
|
||||
const sent = createMemo(() => {
|
||||
// A plain function, not a memo, so each menu open compares against the current day.
|
||||
const sent = () => {
|
||||
const created = new Date(props.message.time.created)
|
||||
const now = new Date()
|
||||
const midnight = (date: Date) => new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime()
|
||||
@@ -335,7 +336,7 @@ export function CurrentUserMessageDisplay(props: {
|
||||
}).format(created)
|
||||
|
||||
return new Intl.DateTimeFormat(i18n.locale(), { dateStyle: "medium", timeStyle: "short" }).format(created)
|
||||
})
|
||||
}
|
||||
|
||||
// A waiting steer reads agent · model · Pending; mobile shows the agent and model in the composer instead.
|
||||
const metaLabels = createMemo(() => (mobile() ? [] : [...agentItems(), ...modelItems(data, props.model)]))
|
||||
|
||||
Reference in New Issue
Block a user