Show week only with Fullcalendar events

Asked

Viewed 639 times

3

The Fullcalendar has the button of Prev and Next that advance and return the weeks, if it keeps advancing it goes showing the weeks infinitely, if it returns also.

I need a function that allows displaying only weeks containing marked events.

For example: If I have an event on 02/15/2014 and another event on 08/20/2015, the Prev and next buttons can only alternate in these two weeks.

Does anyone know of any function that allows to do this in fullcalendar?

I tried to search for some function in the Docs of the site of fullcalendar, but I did not find any of this, follow link: http://fullcalendar.io/docs/

  • could try that by clicking the next button and there are no more events, the button will be disabled. See in the documentation the function that fetches the events and the return of this function. If the return is 'null', you disable the button.

  • That answer seems to show a difficulty in understanding library events.

  • Solved, soon I will put the code here.

1 answer

4


Follows code:

follow js that takes initial date and final date registered and limits the V and next arrows of fullcalendar:

viewRender: function(view,element) {
      var now = moment('<?php print $eventos_agenda[0]->data_clicada ?>');
        var end = moment('<?php print $eventos_agenda[$final]->data_clicada ?>');
                    if ( end < view.end) {
                       $("#botao_passa").addClass('disabled');
                    }
                    else {
                       $("#botao_passa").removeClass('disabled');
                    }
                    if ( view.start < now) {
                       $("#botao_volta").addClass('disabled');
                    }
                    else {
                       $("#botao_volta").removeClass('disabled');
                    }
                },
  • Then mark your reply as accepted. Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.