Begin Of Current Week, First day of the week

Hi In my project I need to retrieve Date and time at the beginning of the current week so i'm using %BeginOfCurrentWeek% token in the XPath. It always considers Monday as the first day of the week. How can I make it returns Sunday as the first day of the week? I have tried this : From the settings of the project I selected the model tab. Then from the list of the "First day of the week" field I selected "Sunday" instead of "Default" unfortunately this did not solve the problem and i did not note any changes. Is this the correct way but there is a bug in mendix? or there is another solution? And if this is not the solution, what is the functionality of "First day in the week" in the project settings? Thanx in advance, Omar
2 answers

Omar, you could use addDays([%BeginOfCurrentWeek%],-1) to extract 1 day from Monday to achieve what you want. It's not what you really want, but it works.

It would be better to do it just with the BeginOfCurrentWeek token but that doesn't work (BUG?). If that one isn't working, you could file a bug report.

Edit after comment Rom van Arendonk:

addDays cannot be used. Used [%BeginOfCurrentWeek%] - [%DayLength%] instead.


I just had a look, at the moment this first day of week is always Monday.

There are several ways this could be improved. My initial thought is that it should be dependent on the timezone that you set for a certain user. This means that individual users can have different first days of the week. The calendar picker ideally would use this setting too.

However this might be inconvenient if you really count on the first day always being Sunday or Monday. I'm not sure what cases there are for this. For example, what are you using the begin of current week for in this xpath query?