How to get current displayed date range in full calendar jquery

Manoj picture Manoj · Sep 25, 2015 · Viewed 22.9k times · Source

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

Ashok Kumawat picture Ashok Kumawat · Sep 25, 2015

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;
    }