Events List – Duration Format

Home Forums Calendar Products Events Calendar PRO Events List – Duration Format

Viewing 15 posts - 1 through 15 (of 26 total)
  • Author
    Posts
  • #1013596
    Lara
    Participant

    I am using the Pro Events List shortcode and would like the Duration to only show the dates in the following format: October 12 – 16, 2015. How do I modify this? I’ve already done some customization to the way the shortcode shows my events, but I don’t know where to change this. Can it be done? Thanks!

    #1013710
    Geoff
    Member

    Hey Lara–nice to see you again. 🙂

    I’ve done this one other time before and–though it turned out to be quite a beast–adding this to the functions.php file seemed to do the trick.

    That changes the date format so that it follows M D – D, Y when a multi-day event is taking place.

    I hope this helps!

    Geoff

     

    #1013725
    Lara
    Participant

    Great, thanks! I will give that a try. Also, on the events listing page, what file can I modify to get the location to show?

    #1013740
    Geoff
    Member

    Good question–are you looking to modify a specific view? You can find the templates for any of the calendar views in /the-events-calendar/src/views. You’ll notice there are subfolders from there from where you can get to specific views, like List View or Month View.

    If you’re looking to modify one of the PRO views instead, you can find those in the events-pro plugin folder instead: /src/views/pro/.

    Oh, and if you haven’t checked it out already, I’d highly suggest looking over our Themer’s Guide because it provides thorough instructions on how to override templates instead of altering them in the plugin folder–excellent to make sure your work is properly saved. 🙂

    Geoff

    #1013753
    Lara
    Participant

    It is the pro photo view I believe. I have been looking through the Themer’s Guide, but will have to make sure I’ve added to the right template. Thanks so much for your help!

    #1013761
    Lara
    Participant

    If I want the Duration to always show the year, can I remove the $format = $date_without_year_format; argument? Also, I forgot to mention I need to remove the start time and end time. Can I just modify what you sent me earlier to accomplish this? Thanks!

    #1013768
    Geoff
    Member

    Yeah, you can totally edit what I provided and remove the start and end times. There’s another filter you can use to remove those as well, which might be a little more manageable. 🙂

    Geoff

    #1013800
    Lara
    Participant

    Thanks again Geoff!

    #1013839
    Lara
    Participant

    I’m still not seeing any information about adding the location to the pro photo single-event listing. I’ve gotten the location to show with the pro list shortcode, but cannot seem to get it to work for the other. I have copied the photo/single-event.php to my child theme.

    I’ve also gotten the year to show up for the dates when there is a date range for the event, but not when it is a single day. Am I missing something in that filter?

    #1014051
    Geoff
    Member

    Hi Lara!

    Just to confirm, is the template override for photo/single-event.php placed in the following folder in your theme: /tribe-events/pro/photo/single-event.php

    I only ask because I’ve made the mistake of not creating a pro folder many times myself and just want to rule that here as well. 🙂

    If it is located correctly, what function are you using to call the location and what info are you trying to display? For example to show the city and state, you could use something like:

    <?php echo tribe_get_city() . ', ' .tribe_get_state(); ?>

    …or, if you want to show the full venue information: tribe_get_venue()

    I’ve also gotten the year to show up for the dates when there is a date range for the event, but not when it is a single day.

    Yeah, that filter is specifically for multi-day events. It will take some additional wrangling to apply the format to single-day events as well. In other words, you’re not missing anything–it just needs to be taken further. 🙂

    Cheers!
    Geoff

    #1014107
    Lara
    Participant

    Hi Geoff-

    I do have the file in the proper folder per your last note. I will need it to show the city and either state/region (can you make that state written out as opposed to the abbreviation in that same snippet or would that be a function?)

    If you could give me some direction for the single day events as well that would be great! Thanks!

    #1014139
    Geoff
    Member

    Hi Lara!

    I do have the file in the proper folder per your last note.

    Hmm, I just tried adding the code I provided to that same template and it seems to work. Perhaps try placing on the line right after this one (Line 44 for me):

    <?php echo tribe_events_event_schedule_details(); ?>

    For the date format, you’ll want to revise the $microformatStartFormat and $microformatEndFormat variables that are defined toward the beginning the snippet so that the tribe_get_start_date() and tribe_get_end_date() functions conform to the date formats you’re looking for.

    #1014159
    Lara
    Participant

    Got it! I just need to work on the date format and having the state spelled out. Thanks 🙂

    #1014236
    Geoff
    Member

    My pleasure! Keep me posted for sure. 🙂

    #1014490
    Lara
    Participant

    Geoff-

    I’ve added this code to my single-event.php page: <?php echo tribe_get_city() . ‘, ‘ .tribe_get_state(); ?>

    It works great! Can I add ‘, ‘ .tribe_get_region(); to make it show the region too?

Viewing 15 posts - 1 through 15 (of 26 total)
  • The topic ‘Events List – Duration Format’ is closed to new replies.