FullCalendar get (displayed) week

I would like to get the week (number) of the displayed week in the FullCalendar Web Component. Or, alternatively, get the displayed date range (displayed in the title header). Unfortunately, I did not find a way to get it. Also, I did not find anything mentioned about getting it in the docu.

Is anybody using the week information from FullCalendar?

Thanks for a hint.

Regards,

Hi Robert,

I think you can use the following

// start
elements.calendar.getView().intervalStart
// end (adds 1 day)
elements.calendar.getView().intervalEnd

Regards,

Hi Robert,

you can set all these kind of options during initialising of the calendar.

Something like this:

var o = {
   weekNumbers: true,
   weekNumberTitle: 'Woche'
}

calendar.fullCalendar(options);

Documentation can be found here:

Like mentioned in the previous post, you can get the start date of the displayed range as:

elements.calendar.getView().intervalStart

The week would then be:

scopes.svyDateUtils.getWeekOfYear(elements.calendar.getView().intervalStart)

Hope this helps

Hi dcamargo

Sorry I don‘t know your real name. Your code line with getView().intervalStart is exactly the solution I was looking for!

Thanks and best regards,
Robert

Hi Marc

I just could use your detailed code line scopes.svyDateUtils.getWeekOfYear(elements.calendar.getView().intervalStart)

as is in my SQL WHERE clause and everything works like a charm. To know getView() is the key.

I have set the options but did not come accross the getView method as idea to geht the interval.

Thanks and best regards,
Robert