Changing the Modern Tribe Events Date Format

This is some code borrowed and extended on to change the Modern Tribes Event plugins date output format to make it a bit easier on the eye.

It is a shortcode [all_the_single_dates] that outputs the dates like so ….

  • 09 – 14 September 2018
  • 28 October – 02 November 2018
  • 17 October 2018

So …

If the dates are in the same month it just outputs the month once.

If the dates cross into different months it outputs multi dates and corresponding months.

If the date is single it just outputs a single date.

If you wanted the month abbreviated swap the F’ with ‘M’

For other date manipulations see here and here.

2 Comments

  1. Stephen Page on September 14, 2018 at 2:08 pm

    “If you wanted the month abbreviated swap the ‘Y’ with ‘M’”

    I believe you meant “If you wanted the month abbreviated swap the ‘F’ with ‘M’”?

    • Neil Gowran on September 15, 2018 at 1:09 am

      Doh! – thanks – updated

Leave a Comment