Sha256: 358966745ff371d63f24d15a7765b52caa6c032b9a634145893f9fe6d19f9ed4
Contents?: true
Size: 486 Bytes
Versions: 26
Compression:
Stored size: 486 Bytes
Contents
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'); }
Version data entries
26 entries across 26 versions & 1 rubygems