Week View day start and end times

Home Forums Calendar Products Events Calendar PRO Week View day start and end times

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #968376
    twkmedia
    Participant

    Hi All,

    Does anyone know of a way of setting the start and end times of days in the calendar Week View. At present it is from 24 hour, from 12:00 – 12:00. Ideally we would like to change this to 7:00 – 20:00.

    Thanks

    #968486
    Brian
    Keymaster

    Hi,

    Thanks for using our plugins.

    There is not method in the current version to change Week View as you ask.

    However, we are about to release 3.10 in the next week or so and that has this ability.

    You can read about it under the new features section of this article:

    https://theeventscalendar.com/week-view-refactor/

    Let me know if you have any follow up questions.

    Thanks

    #973044
    Christina
    Participant

    Brian,
    Where do I customize what hours are displayed on the Week View grid? I want to show a limit of the time view from 8am – 9pm.

    Please advise ASAP… thanks!

    #973111
    Brian
    Keymaster

    Hi Christina,

    If you follow that link in my previous reply and look at the New Features section it has a filter in it to do what you are asking. If you have issues with that filter please create a new thread and we can help you one on one.

    Cheers

    #973201
    Christina
    Participant

    Morning Brian

    I can’t see/find where that filter is in the settings for the Calendar Pro… Is it a .php file that needs to be edited?

    I see that it’s ‘tribe_events_week_get_hours’ but WHERE is that filter located.

    Thanks!
    Christina

    #973215
    Brian
    Keymaster

    This is the filter:

    Add that to your theme’s functions.php and change the 7 and 18 to the times you would like to display.

    add_filter( 'tribe_events_week_get_hours', 'filter_week_hours' );

    function filter_week_hours( $hours ) {
    $hour = 0;

    foreach ( $hours as $key => $formatted_hour ) {
    if ( $hour < 7 || $hour > 18 ) {
    unset( $hours[ $hour ] );
    }

    $hour ++;
    }

    return $hours;
    }

    #973221
    Christina
    Participant

    I’m assuming that this can be added to the end of the existing code? or is there a specific point of entry I should be looking for?

    Many thanks for the assist!
    C

    #973227
    Christina
    Participant

    That worked! thank you.

    #973236
    Brian
    Keymaster

    Great glad it helps.

    I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic on the forum and we can help you out.

    Thanks

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Week View day start and end times’ is closed to new replies.