American Date format

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6911

    Would it be possible to get an American date format for displaying games on a schedule? Something like “Monday, September 5th” or “Sept 5” or some variation of that.

    #6913
    Mark
    Keymaster

      Hi Dan,
      Sorry for the slow reply, I have been out of town. You can set date (and time) formats for the LM shortcodes on the Schedules tab of Settings page on you admin screen. If the built in formats do not meet your needs, there are filters that allow to to set the date and time formats however you would like. See the man page https://shoalsummitsolutions.com/lm-actions-filters/
      -Mark

      #7205
      Owen Gotimer
      Participant

        Hi Dan. We had the same idea and it possible through the shortcode incantation.

        For the date you can add, date_format='XXX' as well as time_format='YYY'.

        You can replace the XXX and YYY with a string. This is a helpful guide: https://www.php.net/manual/en/datetime.format.php.

        For example, we wanted Sat 11/25 as our date, so we used date_format='D n/j'.

        You don’t need to know any code, because you can bake this into your shortcode, as seen below.

        [mstw_league_schedule_table league="boys-basketball" season=2023 show_nonleague=1 show_meets=0 date_format='D n/j' time_format='g:i A']

        Hope this helps!

        #7207
        Mark
        Keymaster

          Dan/Owen-
          What Owen describes above is cool, but it is not supported. (Don’t know why it would go away, but Php has been known to deprecate very useful capabilities.)

          I get the point of not having to code, which is a totally valid point. But advantage of using the filters is that your ‘custom’ date formats will appear in the dropdowns on the settings pages. BTW, getting the PhP date-time formats right is not a small task for a non-programmer either (because they are so powerful). So filters are perhaps a better solution for an ‘admin’ who wants to give other users the ability to set date/time formats in some ‘controlled’ fashion.

          -Mark

        Viewing 4 posts - 1 through 4 (of 4 total)
        • You must be logged in to reply to this topic.