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

Function formatDate

epic/epic.ts:99–106  ·  view source on GitHub ↗
(dateStr: string)

Source from the content-addressed store, hash-verified

97 try {
98 const date = new Date(dateStr);
99 return date.toLocaleString("zh-CN", { timeZone: "Asia/Shanghai", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit" });
100 } catch {
101 return dateStr;
102 }
103}
104
105// 构建游戏信息文本
106function buildGameText(game: EpicGame, index: number): string {
107 const title = htmlEscape(game.title);
108 const desc = game.description.length > 100 ? htmlEscape(game.description.slice(0, 100)) + "..." : htmlEscape(game.description);
109 const start = formatDate(game.startDate);

Callers 1

buildGameTextFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected