MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / formatDateParts

Function formatDateParts

biko/biko.ts:101–127  ·  view source on GitHub ↗
(input: unknown)

Source from the content-addressed store, hash-verified

99 date = new Date(input * 1000);
100 } else if (typeof input === "bigint") {
101 date = new Date(Number(input) * 1000);
102 } else {
103 date = new Date();
104 }
105
106 const day = date.toLocaleDateString("zh-CN", {
107 timeZone: "Asia/Shanghai",
108 year: "numeric",
109 month: "2-digit",
110 day: "2-digit",
111 });
112 const time = date.toLocaleTimeString("zh-CN", {
113 timeZone: "Asia/Shanghai",
114 hour: "2-digit",
115 minute: "2-digit",
116 hour12: false,
117 });
118
119 return { day, time };
120}
121
122function buildEntityDisplay(entity: any, fallbackRaw: string): string {
123 const parts: string[] = [];
124 if (entity?.title) parts.push(String(entity.title));
125 if (entity?.firstName) parts.push(String(entity.firstName));
126 if (entity?.lastName) parts.push(String(entity.lastName));
127 if (entity?.username) parts.push(`@${entity.username}`);
128 if (entity?.id !== undefined && entity?.id !== null) {
129 parts.push(String(entity.id));
130 }

Callers 1

collectMessagesOnceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected