<script>
// Changes the format of date on summary items
var myObj = document.getElementsByClassName('summary-metadata-item--date');
var options = { year: 'numeric', month: 'long', day: 'numeric'};
for (var i = 0; i < myObj.length; ++i) {
var item = myObj[i];
var date = new Date(item.innerHTML);
item.innerHTML = date.toLocaleDateString('en-GB', options);
}
</script>
Hi Folks,
Wondering if anyone can help, I've used the above code to get UK format dates on my summary blocks for events, but this doesn't work with events that have a date range rather than a single date. Wondering if anyone can help me get it working as its beyond my JS skills! It just shows "invalid date" for thumbnails that have an event spanning more than one date
Any advice appreciated