I'm trying to do some calculations on dates with weeknumber and i've noticed that the rich widget Calendar has a "show weeknumber" option. Considering some years have 52 weeks or more this seems like an easy solution. Is it possible to read out the weeknumber on a selected date in the calendar widget? Maybe use it as an output so i can assign it to something else?

Bonus question, how does outsystem calculate the weeknumbers?

May I ask what kind of calculations you'd like to do with the weeknumber? If you only want to calculate how many weeks have passed between two dates, you can use the DiffDays(dt1,dt2) built-in function, as it will return you the number of days between two dates.

I want to select a week number and a year and get 2 dates back. I use these 2 dates in an aggregate to filter my data per week.

The problem is that 01-01-2018 happens to be a Monday but 01-01-2019 is not. So i can't use fixed dates. I can either choose to make the first week of 2019 start at 31-12-2018 since that is a monday, or shorten my first week of 2019 that it starts on a Tuesday and is 6 days instead of 7.

The second option is how Outsystems defines weeknumbers. Which should be fine for my purposes. The downside is that in year 2020 i would have a week 53. So i'll need to think of something where i can dynamically change a combobox from 52 options to 53 or just use the output of the calendar widget.

I'm pretty sure Outsystems uses the ISO weeknumber algorithm. But how and where does it do that? The algorithm is pretty confusing because of the 53's week.