You can do simple date formatting with a library by using the Intl.DateTimeFormat
JavaScript class.
alert( formatDate(new Date()));
// Apr 11, 2019, 1:10:40 PM
function formatDate(date, locale) {
if (!locale)
locale = 'en-us';
return new Intl.DateTimeFormat(locale, {
year: 'numeric',
day: 'numeric',
month: 'short',
hour: 'numeric',
minute: 'numeric',
hour12: true,
}).format(date);
}