How to get current displayed date range in full calendar jquery

I have implemented fullcalendar in my application. I am facing a problem for getting current displayed date range. I want to get currently displayed date range in full calendar. Please suggest me a proper solution.

For example please take a look on this image enter image description here

In this I want to get “20 Sept” and “26 Sept”.

Answer

Try this.

Add this function and call this. It will help you.

  function GetCalendarDateRange() {
        var calendar = $('#calendar').fullCalendar('getCalendar');
        var view = calendar.view;
        var start = view.start._d;
        var end = view.end._d;
        var dates = { start: start, end: end };
        return dates;
    }

Leave a Reply

Your email address will not be published. Required fields are marked *