MCPcopy Create free account
hub / github.com/TheJoWo/Clean-Clode / formatDate

Function formatDate

script.js:260–274  ·  view source on GitHub ↗
(isoString)

Source from the content-addressed store, hash-verified

258 }
259
260 function formatDate(isoString) {
261 const date = new Date(isoString);
262 const now = new Date();
263 const diffMs = now - date;
264 const diffMins = Math.floor(diffMs / 60000);
265 const diffHours = Math.floor(diffMs / 3600000);
266 const diffDays = Math.floor(diffMs / 86400000);
267
268 if (diffMins < 1) return 'Just now';
269 if (diffMins < 60) return `${diffMins}m ago`;
270 if (diffHours < 24) return `${diffHours}h ago`;
271 if (diffDays < 7) return `${diffDays}d ago`;
272
273 return date.toLocaleDateString();
274 }
275
276 function createHistoryDeleteButton(itemId) {
277 const btn = document.createElement('button');

Callers 1

updateHistoryDisplayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected