MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / formatChatDateLabel

Function formatChatDateLabel

deployments/desktop/static/desktop.js:4281–4290  ·  view source on GitHub ↗
(dateValue)

Source from the content-addressed store, hash-verified

4279 }
4280
4281 function formatChatDateLabel(dateValue) {
4282 const date = String(dateValue || "").slice(0, 10);
4283 if (!date) return ui().chat.ungrouped;
4284 if (date === todayDateValue()) return ui().chat.today;
4285 const yesterday = new Date();
4286 yesterday.setDate(yesterday.getDate() - 1);
4287 const yesterdayValue = `${yesterday.getFullYear()}-${String(yesterday.getMonth() + 1).padStart(2, "0")}-${String(yesterday.getDate()).padStart(2, "0")}`;
4288 if (date === yesterdayValue) return ui().chat.yesterday;
4289 return date;
4290 }
4291
4292 function formatChatTime(value) {
4293 const text = String(value || "");

Callers 1

renderChatHistoryFunction · 0.85

Calls 2

uiFunction · 0.85
todayDateValueFunction · 0.85

Tested by

no test coverage detected