Question
Optus
AU
Last activity: 26 Aug 2020 8:41 EDT
How to change the start date of Calendar?
Hi Team,
I have a requirement to change the start date of a calendar to Monday(When click on a calendar icon), a quick response much appreciated.
Thanks in advance.
Regards,
Satish
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
IN
The first day of week depends on the user country (-Duser.country jvm argument )
The below report is executed from Pega designer studio. In this report the filter criteria is greater than “Previous Week” on a datetime filed.
Below are the SQL query generated for two different JVM settings.
Case 1: user country = GB, Monday is the first day of the week.
SMA --> Advanced --> Web Tier Runtime Environment.
The first day of week depends on the user country (-Duser.country jvm argument )
The below report is executed from Pega designer studio. In this report the filter criteria is greater than “Previous Week” on a datetime filed.
Below are the SQL query generated for two different JVM settings.
Case 1: user country = GB, Monday is the first day of the week.
SMA --> Advanced --> Web Tier Runtime Environment.
Case2: country = US, Sunday is the first day of the week.
In the above report execution for country = GB the report fetches data from 18th December 2017 00:00:000 hours which is Monday and the first date of the week as per the jvm Locale settings.
For the second case i.e. country = US the report fetches data from 17th December 2017 00:00:000 hours which is Sunday and the first date of the week as per the jvm Locale settings.
The user country must be set to enforce locale from the JVM level so that Java Calendar methods work accordingly.
The JVM argument is –Duser.country=XX. (XX = IN, GB, TR, US, etc)
The language JVM argument is –Duser.language=ll (ll = tr, fr, en, etc).
Pegasystems Inc.
IN
Hi
it depends on your operator locale .
When the locale is set something other than US ( en_US ) , Canada ( en_CA) and Japan ( ja_JP ) , the first day will be picked as Monday.
So if you have to change it, this is the quickest way !
Optus
AU
Hi Santanu,
Thanks for reply. Based on locale we perform some time calculations, so it may affect these calculations. Is there any other way to change the start date of calender?
Pegasystems Inc.
IN
Hi
I checked the underlying code for calendar as well. com.pega.pegarules.pub.util.PRDateFormat.getFirstWeekDay() is responsible for this which in turn checkign the user locale.
So I dont think out of the box you can achieve this without changing your locale.
As alternative, you can opt for showing dates as drop downs. Or else, you can think of writing your own java script code to display your customized calendar .
Optus
AU
Hi Santanu, thanks for the suggestion. I will try to customize the calendar functionality.
Adqura
TR
Hi Santanu,
I tested what you suggested in this post but it doesn't seem to work in Pega 7.2 (java_1.7_64).
I created a simple report definition and picked "Previous week" in the filter condition. My locale is en_GB.
When I trace the SQL generated by RD above, it takes end of Saturday i.e. Sunday as the first day of the week.
Hi Santanu,
I tested what you suggested in this post but it doesn't seem to work in Pega 7.2 (java_1.7_64).
I created a simple report definition and picked "Previous week" in the filter condition. My locale is en_GB.
When I trace the SQL generated by RD above, it takes end of Saturday i.e. Sunday as the first day of the week.
Previous Week in Report Definition
====================================================================
Database Name InteractionHistory
SQL SELECT "PC0".PXFACTID AS "pxFactID"
, "PC0".PXOUTCOMETIME AS "pxOutcomeTime"
FROM PMIH.PR_DATA_IH_FACT "PC0"
WHERE ( "PC0".PXOUTCOMETIME > ? )
SQL Inserts <2017-12-09 23:59:59.999>
Connection ID 16
High Level Op ID 9823
High Level Op list using a list spec
Object Class Data-Decision-IH-Fact
SQL insert value is December 9th, which is (end of) Saturday. I want it to be end of Sunday.
Is there any other parameter that has precedence over operator locale?
Regards,
Accepted Solution
Pegasystems Inc.
IN
The first day of week depends on the user country (-Duser.country jvm argument )
The below report is executed from Pega designer studio. In this report the filter criteria is greater than “Previous Week” on a datetime filed.
Below are the SQL query generated for two different JVM settings.
Case 1: user country = GB, Monday is the first day of the week.
SMA --> Advanced --> Web Tier Runtime Environment.
The first day of week depends on the user country (-Duser.country jvm argument )
The below report is executed from Pega designer studio. In this report the filter criteria is greater than “Previous Week” on a datetime filed.
Below are the SQL query generated for two different JVM settings.
Case 1: user country = GB, Monday is the first day of the week.
SMA --> Advanced --> Web Tier Runtime Environment.
Case2: country = US, Sunday is the first day of the week.
In the above report execution for country = GB the report fetches data from 18th December 2017 00:00:000 hours which is Monday and the first date of the week as per the jvm Locale settings.
For the second case i.e. country = US the report fetches data from 17th December 2017 00:00:000 hours which is Sunday and the first date of the week as per the jvm Locale settings.
The user country must be set to enforce locale from the JVM level so that Java Calendar methods work accordingly.
The JVM argument is –Duser.country=XX. (XX = IN, GB, TR, US, etc)
The language JVM argument is –Duser.language=ll (ll = tr, fr, en, etc).