Home › Forums › Calendar Products › Events Calendar PRO › Modifying Date/Time format in Widget List View
- This topic has 11 replies, 2 voices, and was last updated 6 years, 8 months ago by David.
-
AuthorPosts
-
June 25, 2017 at 11:37 am #1303840DavidParticipant
Currently the list view in EC PRO shows the Date/Time icon using the abbreviation and number for the day (ex. FRI 30)
I would like it to display the month day and year in the F j, Y format (ex. July 4, 2017)
I am having difficulty locating the template (or method) to complete this customization. I have gone through many of the template files and used the Themer’s Guide but so far no luck.
I was hoping you might assist and point me in the right direction.
Thanks in advance!
Dave
June 28, 2017 at 6:42 am #1310101BarryMemberHi Dave,
Thanks for posting and our apologies for the delay in responding.
The first thing to do here is check out the Date Format Settings found in the Events → Settings → Display screen: if tweaking these doesn’t help then we’ll need to take another look — and if you could share your domain (by private reply if you prefer) that might help us to gather some insights into the problem.
Let me know how you get on 🙂
June 28, 2017 at 6:52 am #1310114BarryMemberHi again Dave,
I unfortunately missed that you were referencing the list widget. To change the date format used here, you would need to adjust the following template from Events Calendar PRO:
views/pro/widgets/modules/single-event.php
Following the steps described here please copy this to your theme and make the changes there:
YOUR_THEME/tribe-events/pro/widgets/modules/single-event.php
The section of code you are looking for is the <div class=”list-date”> section, and you can simplify that down to use whatever format you prefer.
Does that help? Let me know if you need any further direction!
July 5, 2017 at 9:28 pm #1316641DavidParticipantThis reply is private.
July 5, 2017 at 9:31 pm #1316645DavidParticipantThe styling is the easy part but I need to get the year in there so I can format it like the attached screenshot from the design comp. It looks like the title and city/state info can be handled directly in the short code correct?
July 6, 2017 at 11:33 am #1317030BarryMemberOK – were you able to setup a template override like I outlined in my last reply?
July 6, 2017 at 11:40 am #1317035DavidParticipantHi Barry – Yes I was able to set up the override. The issue I am having is implementing the proper PHP in order to have the year included with the date/time structure as it is currently set up.
- This reply was modified 6 years, 9 months ago by David.
July 6, 2017 at 12:37 pm #1317071BarryMemberGotcha.
Well, in that template, you will see code like this:
<div class="list-date"> <?php if ( isset( $instance['tribe_is_list_widget'] ) && date( 'm', $post_date ) != date( 'm', current_time( 'timestamp' ) ) ) : ?> <span class="list-dayname"> <?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'M', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?> </span> <?php else: ?> <span class="list-dayname"> <?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'D', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?> </span> <?php endif; ?> <span class="list-daynumber"><?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_daynumber', date_i18n( 'd', $post_date ), $post_date, $mini_cal_event_atts['class'] ); ?></span> </div>
Try changing it to this (which is much shorter):
<div class="list-date"> <?php echo tribe_get_start_date( $post_id, false, 'M j, Y' ); ?> </div>
That help?
July 7, 2017 at 10:03 pm #1317782DavidParticipantHi Barry,
Thanks that did the trick! I really appreciate the clear and direct help on this ticket…very much appreciated.
Have a great weekend.
Dave
July 10, 2017 at 3:00 pm #1318632BarryMemberExcellent!
August 1, 2017 at 9:35 am #1328857Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Modifying Date/Time format in Widget List View’ is closed to new replies.