Support Article
First day of week does not change to Monday
Summary
In report definitions, when 'previous week' is selected as a filter criteria, the week starts from Sunday.
One must change the first day of week to Monday from Sunday.
Following the PDN article in the link below, user changed the default locale to tr_TR but that does not help:
https://pdn.pega.com/community/pega-product-support/question/how-change-start-date-calendar
Error Messages
Not Applicable
Steps to Reproduce
- Create a report definition.
- Add filter condition.
- From select values button choose previous week.
Root Cause
The pxWeek Function alias works in this manner.
Resolution
User can customize Rule-Alias-Function pxWeek as per the requirement and use that in filters.
A sample guide for the implementation could like below :
There are few other Out-of-the-box (OOTB) functions as well that could be used in conjunction to achieve the requirement.
For example, the Day Of Week


Click the fx button to open the below window:
Here the pxDayOfWeek returns the value of the Today’s date with respect to the first day of the week.
The first day of the week can be set to 2 as Monday which becomes input parameter to this function.
Thus if Today is Wednesday the output of this function will be 2 (Wednesday – Monday).
Thus user requires the Previous Monday (of the Previous Week alias) the calculation will be like below:
Previous Monday = [(Current Day) – {pxDayofWeek(Current_TimeStamp, 2) +7}]
Thus the custom function should have a code that will take the pxDayOfWeek function as the input and add 7 to it.
Then the sum needs to be subtracted from Today’s date to arrive previous Monday.
Similarly for custom Next Week alias the output of the pxDayOfWeek function( that comes as an input parameter) should be subtracted from 7, to arrive next Monday.
Published March 22, 2018 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.