How to add Start/End Date/Time to Monthly View Template

Home Forums Calendar Products Events Calendar PRO How to add Start/End Date/Time to Monthly View Template

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1195694
    Mike
    Participant

    I am attempting to add in the start/end date & time to the Monthly view template. Here is the code I currently have in place:

    <?php echo tribe_get_start_date( $event_id, true, 'D, M j, g:i' ); ?>-<?php echo tribe_get_end_time( $event_id, 'g:i' ); ?>

    This works fine in the Photo view in pulling up a formatted date, but is returning a blank field for the request. Any ideas?

    Thanks for the help.

    #1195716
    Mike
    Participant

    And, on a related note, what is the code for available tickets? Here is the code I am using on the other template pages:

    <?php echo tribe_events_count_available_tickets(); ?>

    So far, it looks like only event featured image, title, venue, and URL are working. Ironically, custom fields were a snap to add. Is there a reason for this? Is the monthly view handled differently?

    The total fields I need to pull:

    Start Date
    Start Time
    End Time
    Available Tickets

    Thanks!

    • This reply was modified 9 years, 5 months ago by Mike.
    #1196274
    George
    Participant

    This reply is private.

    #1197188
    Mike
    Participant

    I am quite familiar with the Themer’s Guide, and how to call the various data sets in customized templates. Unfortunately, Start/End Date/Time function does not appear to be working in the Month views. See function call below:

    <?php echo tribe_get_start_date( $event_id, true, 'D, M j, g:i' ); ?>-<?php echo tribe_get_end_time( $event_id, 'g:i' ); ?>

    These come from the following function lists in your KB:
    https://theeventscalendar.com/function/tribe_get_start_date/
    https://theeventscalendar.com/function/tribe_get_end_date/

    That snippet works in all the other templates EXCEPT for the Monthly view. Is there a reason for this? Is there a month specific code that I should be using? I understand you don’t help with customization, but I am asking for instruction on why your functions are NOT working, which should be a legitimate use of your support channels.

    #1198425
    George
    Participant

    Hi Mike,

    I cannot recreate any troubles with this in the month view.

    Can you please copy and paste your FULL customized month view file (the one where these functions don’t work) into a Gist at http://gist.github.com, then share a link to that Gist here in your reply?

    I will look at your complete file and try to see what’s going on…

    Thanks,
    George

    #1198833
    Mike
    Participant

    This reply is private.

    #1199081
    George
    Participant

    This reply is private.

    #1199248
    Mike
    Participant

    That works, thanks!

    For any future code modifiers, here is the proper code to display a modified start/end date on the Monthly view calendar:

    <?php echo tribe_get_start_date( null, true, 'D, M j, g:i' ); ?>-<?php echo tribe_get_end_time( null, 'g:i' ); ?>

    Use this reference to modify the date format as needed:
    http://www.w3schools.com/php/func_date_date_format.asp

    #1199497
    George
    Participant

    Thanks for sharing, Mike, and for your patience here.

    Best of luck with your customizations!

    — George

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘How to add Start/End Date/Time to Monthly View Template’ is closed to new replies.