IsBusinessDay returns incorrect value for different timezones
SummaryWhen a user's timezone is different from the calendar's timezone, the Pega function 'isBusinessDay' returns the incorrect value. Example: The user's timezone is Australia/Adelaide. The calendar instance is defined in the America/New_Yorktimezone. A date of 1/17/2017 is selected (which is not a business holiday but 1/16/2017 is). In this case, the isBusinessDay fn returns false as its response.
Error MessagesNot Applicable
Steps to Reproduce
- Set the user's timezone to Australia/Adelaide.
- Create a Calendar instance with the America/New_Yorktimezone. On the calendar instance, mark 1/16/2017 as a closed day.
- Have a date input and select 1/17/2017 as the date.
- Execute the onchange action on the date input to trigger a function to check if the input date is a business holiday.
- Observe the system returns false as the output of the isBusinessDay function.
Root CauseWhen time-value is omitted, it is defaulted, and the defaulted value may fall on a different day in a different time zone.
ResolutionPass a date-time to the isBusinessDay function, not just a date.
Published January 23, 2017 - Updated January 24, 2017