# FullCalendar get (displayed) week

**URL:** <https://forum.servoy.com/t/fullcalendar-get-displayed-week/20244>\
**Category:** Questions\
**Created:** [May 29, 2020, 9:16am UTC](https://forum.servoy.com/t/fullcalendar-get-displayed-week/20244 "2020-05-29T09:16:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![huber](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/huber/32/5042_2.png) [@huber](https://forum.servoy.com/u/huber)\
**Post date:** [May 29, 2020, 9:16am UTC](https://forum.servoy.com/t/fullcalendar-get-displayed-week/20244/1 "2020-05-29T09:16:26Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![dcamargo](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dcamargo](https://forum.servoy.com/u/dcamargo)\
**Post date:** [May 29, 2020, 1:54pm UTC](https://forum.servoy.com/t/fullcalendar-get-displayed-week/20244/2 "2020-05-29T13:54:48Z")

</div>

Hi Robert,

I think you can use the following

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

```

Regards,

---

<div class="post-metadata">

**Author:** ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)\
**Post date:** [May 29, 2020, 1:59pm UTC](https://forum.servoy.com/t/fullcalendar-get-displayed-week/20244/3 "2020-05-29T13:59:23Z")

</div>

Hi Robert,

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

Something like this:

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

calendar.fullCalendar(options);

```

Documentation can be found here:

> **[weekNumbers - Docs
    
    
      
        v3
      
    
  
  | FullCalendar](https://fullcalendar.io/docs/v3/weekNumbers)**
>
> Determines if week numbers should be displayed on the calendar.

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

```auto
elements.calendar.getView().intervalStart

```

The week would then be:

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

```

Hope this helps

---

<div class="post-metadata">

**Author:** ![huber](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/huber/32/5042_2.png) [@huber](https://forum.servoy.com/u/huber)\
**Post date:** [May 29, 2020, 7:17pm UTC](https://forum.servoy.com/t/fullcalendar-get-displayed-week/20244/4 "2020-05-29T19:17:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![huber](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/huber/32/5042_2.png) [@huber](https://forum.servoy.com/u/huber)\
**Post date:** [May 29, 2020, 7:31pm UTC](https://forum.servoy.com/t/fullcalendar-get-displayed-week/20244/5 "2020-05-29T19:31:51Z")

</div>

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
