MCPcopy Create free account
hub / github.com/msgbyte/tailchat / getMessageTimeDiff

Function getMessageTimeDiff

client/shared/utils/date-helper.ts:33–41  ·  view source on GitHub ↗
(input: Date)

Source from the content-addressed store, hash-verified

31 * 获取消息显示时间
32 */
33export function getMessageTimeDiff(input: Date): string {
34 const date = dayjs(input);
35
36 if (isToday(date)) {
37 return date.fromNow();
38 } else {
39 return date.format('YYYY-MM-DD HH:mm:ss');
40 }
41}
42
43/**
44 * 小时消息时间

Callers 1

Calls 1

isTodayFunction · 0.85

Tested by

no test coverage detected