UNPKG

lbx-invoice

Version:

Provides functionality around generating invoices.

19 lines 637 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.dateTo102 = void 0; /** * Formats the given date as YYYYMMDD. * @param value - The date to format. * @returns The formatted date. */ function dateTo102(value) { const date = new Date(value); const year = date.getFullYear(); const month = date.getMonth() + 1; const monthString = month > 9 ? `${month}` : `0${month}`; const day = date.getDate(); const dayString = day > 9 ? `${day}` : `0${day}`; return `${year}${monthString}${dayString}`; } exports.dateTo102 = dateTo102; //# sourceMappingURL=date-to-102.function.js.map