Summary Block: Date format

To change Date format in Summary Block from Month Day, Year to Day Month, Year. For example, this.

To this.

You can use this code to Page Header Injection (Page where you use Summary Block)

<script>
document.addEventListener('DOMContentLoaded', function() {
  document.querySelectorAll('.summary-metadata-item--date').forEach(function(element) {
    const dateText = element.textContent.trim();
    const dateMatch = dateText.match(/^(\w{3}) (\d{1,2}), (\d{4})$/);
    
    if (dateMatch) {
      const month = dateMatch[1];
      const day = dateMatch[2];
      const year = dateMatch[3];
      
      element.textContent = `${day} ${month}, ${year}`;
    }
  });
});
</script>

Buy me a coffee