Home › Forums › Calendar Products › Events Calendar PRO › How to add Start/End Date/Time to Monthly View Template
- This topic has 9 replies, 3 voices, and was last updated 9 years, 4 months ago by
Mike.
-
AuthorPosts
-
November 22, 2016 at 2:57 am #1195694
Mike
ParticipantI 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.
November 22, 2016 at 4:52 am #1195716Mike
ParticipantAnd, 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 TicketsThanks!
-
This reply was modified 9 years, 5 months ago by
Mike.
November 22, 2016 at 6:53 pm #1196274George
ParticipantThis reply is private.
November 24, 2016 at 4:15 pm #1197188Mike
ParticipantI 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.
November 28, 2016 at 8:57 am #1198425George
ParticipantHi 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,
GeorgeNovember 28, 2016 at 6:30 pm #1198833Mike
ParticipantThis reply is private.
November 29, 2016 at 8:11 am #1199081George
ParticipantThis reply is private.
November 29, 2016 at 10:05 am #1199248Mike
ParticipantThat 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.aspNovember 29, 2016 at 4:35 pm #1199497George
ParticipantThanks for sharing, Mike, and for your patience here.
Best of luck with your customizations!
— George
-
This reply was modified 9 years, 5 months ago by
-
AuthorPosts
- The topic ‘How to add Start/End Date/Time to Monthly View Template’ is closed to new replies.
