Home › Forums › Calendar Products › Events Calendar PRO › Editing time/date values
- This topic has 4 replies, 2 voices, and was last updated 12 years, 2 months ago by
Brook.
-
AuthorPosts
-
January 14, 2014 at 4:10 pm #92588
Kelly
ParticipantIs there a way that I can edit <?php echo tribe_events_event_schedule_details(); ?> in list-widget.php to output: <span>Tues</span> <span>Jan</span> <span>14</span>
I’m hoping to customize its styling, but can’t quite figure out how to apply the docs. Thanks 🙂
January 15, 2014 at 12:14 pm #93142Brook
ParticipantHowdy dotwongdotcom,
You are looking in the right place! That last paragraph in the docs is what you want in this case. You would want to add a filter to tribe_events_event_schedule_details, and then you can return whatever styling you want.
Not though the sheer amount of logic associated with tribe_events_event_schedule_details(). There are a lot of possibilities for how a date should be displayed. In your overriding function you might want to account for all the same possibilities. I leave it to you to decide. Within the tribe_events_event_schedule_details() you will see how you can pull the current posts date using functions like tribe_get_start_date(), and then you can format it however you please in your overriding filter.
Does that help? I hope you are able to get it working. Please let me know. Thanks!
– Brook
January 15, 2014 at 1:34 pm #93172Kelly
ParticipantWould you be able to start me off? Do I add something like this to the top of list-widget.php so that it doesn’t change the settings site wide?
<?php function tribe_events_event_schedule_details( $event = null ) {
if ( is_numeric( $event ) )
$event = get_post( $event );$settings = array(
‘same_year_format’ => ‘M j’,
);}
} return apply_filters( ‘tribe_events_event_schedule_details’, $schedule ); ?>Like I said in my last comment on the other post, I’m doing my best to do this using common sense. Thanks for your help.
January 15, 2014 at 9:07 pm #93358Kelly
ParticipantI figured out a way to do it. Unless you have a suggestion for a more efficient way to go about things, this will do the trick 🙂
<?php echo tribe_get_start_date($post->ID, false, “D”); ?>
<?php echo tribe_get_start_date($post->ID, false, “M”); ?>
<?php echo tribe_get_start_date($post->ID, false, “j”); ?>I will then wrap spans around each one and style them accordingly.
January 16, 2014 at 9:19 am #93570Brook
ParticipantThat is a great idea. Since it sounds like you found the proper place to insert or filter those additions, then you are set!
-
AuthorPosts
- The topic ‘Editing time/date values’ is closed to new replies.
