VIEW DEMO
let currentDate = new Date();
let datesArray = [];
let shortMonths = new Array('jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec');
let fullMonths = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
let inputDates = "7-sep, 14-sep, 21-sep, 28-sep, 5-oct,12-oct, 19-oct,26-oct,...
var xDate = inputDates.split(',');
$.each(xDate, function (i, val) {
let dateParts = ($.trim(val)).split('-');
let newDate = new Date(shortMonths.indexOf(dateParts[1]) + 1 + ',' + dateParts[0] + ',' + currentDate.getFullYear());
let dayOfMonth = newDate.getDate();
let formattedDate = dayOfMonth + ([, 'st', 'nd', 'rd'][/1?.$/.exec(dayOfMonth)] || 'th') + ' ' + fullMonths[newDate.getMonth()] + ' ' + newDate.getFullYear();
datesArray.push(formattedDate);
});
console.log(datesArray);
Updated VIEW DEMO
$.each(datesArray, function (i, val) {
$('tbody').append('<tr><td>' + val +
'</td><td>Price Here</td><td>Note Here</td></tr>');
});
This code snippet has been enhanced with a table element to display the processed dates.