Files
agentic-labs-challenge/adaptive-loop/node_modules/loupe/lib/date.js
T
AlexKucera 2c1d0fc4d0 (Adaptive Loop) Pass 3
(Adaptive Loop) Record freeze commit hash in context manifest
2026-08-13 15:23:35 +02:00

12 lines
486 B
JavaScript

import { truncate } from './helpers.js';
export default function inspectDate(dateObject, options) {
const stringRepresentation = dateObject.toJSON();
if (stringRepresentation === null) {
return 'Invalid Date';
}
const split = stringRepresentation.split('T');
const date = split[0];
// If we need to - truncate the time portion, but never the date
return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, 'date');
}