UNPKG

@genexus/web-standard-functions

Version:

GeneXus JavaScript standard functions library for web generators

25 lines 845 B
"use strict"; /** * Returns the name of the month for the given date in the selected language. * @param {GxDate | GxDatetime} dateFrom * @param {string} language * @return string */ Object.defineProperty(exports, "__esModule", { value: true }); exports.monthName = void 0; const luxon_1 = require("luxon"); const core_1 = require("./core"); const core_2 = require("../date/core"); const monthName = (dateFrom, language) => { let month = luxon_1.DateTime.fromJSDate(dateFrom) .setLocale((0, core_1.gxToLibLangMapping)(language)) .toFormat("LLLL"); return dateFrom.getTime() === core_2.EMPTY_DATE_VALUE.getTime() ? "" : month .charAt(0) .toUpperCase() .concat(month.substring(1, month.length)); }; exports.monthName = monthName; //# sourceMappingURL=monthName.js.map