Support Article

IsBusinessDay returns incorrect value for different timezones

SA-32790

Summary



When 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 Messages



Not Applicable


Steps to Reproduce

  1. Set the user's timezone to Australia/Adelaide.
  2. Create a Calendar instance with the America/New_Yorktimezone. On the calendar instance, mark 1/16/2017 as a closed day.
  3. Have a date input and select 1/17/2017 as the date.
  4. Execute the onchange action on the date input to trigger a function to check if the input date is a business holiday.
  5. Observe the system returns false as the output of the isBusinessDay function.


Root Cause



When time-value is omitted, it is defaulted, and the defaulted value may fall on a different day in a different time zone.


Resolution



Pass a date-time to the isBusinessDay  function, not just a date.

Published January 23, 2017 - Updated January 24, 2017


0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.