Editing time/date values

Home Forums Calendar Products Events Calendar PRO Editing time/date values

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #92588
    Kelly
    Participant

    Is 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 🙂

    #93142
    Brook
    Participant

    Howdy 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

    #93172
    Kelly
    Participant

    Would 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.

    #93358
    Kelly
    Participant

    I 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.

    #93570
    Brook
    Participant

    That is a great idea. Since it sounds like you found the proper place to insert or filter those additions, then you are set!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Editing time/date values’ is closed to new replies.