Formats an input date string into “DD/MM/YYYY” format using moment.js

  /**          * Formats an ISO date string into “DD/MM/YYYY” format.          *          * @param {string} isoDateStr – The ISO date string to be formatted.          * @returns {string} – The formatted date string in “DD/MM/YYYY” format.        … Continue reading Formats an input date string into “DD/MM/YYYY” format using moment.js

Function to format date (instead of using format or moment.js) Suitescript 1.0

unction formatNSDate(fld, datePassed) {    try {        dLog(‘datePassed : ‘ + fld + ‘ =’, datePassed);                  var monthMap = {            ‘jan’: ’01’, ‘feb’: ’02’, ‘mar’: ’03’, ‘apr’: ’04’,            ‘may’: ’05’, ‘jun’: ’06’, ‘jul’: ’07’, ‘aug’: ’08’,            ‘sep’: ’09’, ‘oct’: ’10’, ‘nov’: ’11’, ‘dec’: ’12’        };          // Get date format from user preference        var dateFormat;… Continue reading Function to format date (instead of using format or moment.js) Suitescript 1.0