Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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_York timezone. 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_York timezone. 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 24, 2017 - Updated October 8, 2020

Was this useful?

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.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us