• Resolved damianba

    (@damianba)


    Hello, is it possible to show events for next 7 days in list view? This is important because at the end of the week (‘listWeek’) sometimes you are left off with 1 event (eg. on Friday) which mislead to believe that there are no other events after the Friday – I want to show also events from next week

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author moiseh

    (@moiseh)

    Hi,
    You can add the following code into your theme functions.php:

    add_filter('wbc_fullcalendar_options', function($options){
        $options['firstDay'] = date('w');
        return $options;
    }, 10, 1);

    This will define the firstDay parameter to FullCalendar. I’ve found this trick in: https://stackoverflow.com/questions/29857212/fullcalendar-js-custom-start-date-in-weekview

    If this fix and don’t cause other issues i may define as default on plugin for next updates.

    Thread Starter damianba

    (@damianba)

    Thank you very much

    Thread Starter damianba

    (@damianba)

    This works for me flawless on week view:

    add_filter('wbc_fullcalendar_options', function($options){
        $options['firstDay'] = date('w')+1;
        return $options;
    }, 10, 1);

    Need to offset +1, don’t exactly know why

    Plugin Author moiseh

    (@moiseh)

    Great thanks ??

    I’m not sure but you may have issues when week resets, like Sunday or Monday depending where you live. For example when Saturday comes and it’s the last day of week (7), you will get 8 instead 0 (that is first day of week).

    Maybe it’s a good idea to use instead:
    $options['firstDay'] = date('w', strtotime('+1 day'));

    Thread Starter damianba

    (@damianba)

    @after update, indeed I need to use just date('w')

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show next 7 days – list view’ is closed to new replies.