We have two dates, the status date: rcareviewdate and Etc date:rcainprgdate. The script below calculates the duration in Hours excluding weekends between these two dates based on attribute status date change.
When we change the status it will calculate overdue for previous status ETC date and current status change date.
Launch Point Type: Attribute Launch Point
Attribute: CHANGEDATE
#Imports
from java.util import Datefrom java.text import SimpleDateFormatfrom psdi.mbo import MboConstantsfrom psdi.server import MXServerfrom java.util import Calendarfrom psdi.app.common import DateUtility#Milliseconds ConstantsMILLISECONDS_DAY= 86400000MILLISECONDS_HOUR = 3600000MILLISECONDS_MINUTE = 60000#Default hours and minutes valuesdays = 0hours = 0minutes = 0