Previous Business Date With Australia Day Light saving Logic

 
This post contains logic related to find the previous business day using the Data transform based on the calendar which is passed .




Extracted Table

#ActionTargetRelationSource
1SetParam.DateAESTequal to@DateTime.FormatDateTime(@DateTime.addToDate(@CurrentDateTime(),'0','0','0','0','0','0'),'yyyyMMdd','Australia/Sydney','en_AU')
2SetParam.PreviousBusinessDayAESTequal to@addDays(Param.DateAEST,-1,true,'AUDefault')
3SetParam.DateGMTequal to@CurrentDate('yyyyMMdd','GMT')
4SetParam.PreviousBusinessDayGMTequal to@addDays(Param.DateGMT,-1,true,'AUDefault')
5SetParam.DaylightSavingequal to@InDaylightSaving('Australia/NSW',@CurrentDateTime())
6When@CompareDates(Param.DateAEST,Param.DateGMT)
6.1When@equalsIgnoreCase(Param.DaylightSaving,true)
6.1.1Setparam.StartDateequal to@addToDate(Param.DateGMT,'',13,'','')
6.1.2SetParam.PreviousBusinessDayStartDateequal to@addToDate(Param.PreviousBusinessDayGMT,'',13,'','')
6.1.3SetParam.PreviousBusinessDayEndDateequal to@DateTime.addToDate(param.PreviousBusinessDayStartDate,'1','','','')
6.1.4SetParam.PreviousDayequal to@DateTime.addToDate(param.StartDate,'-1','','','')
6.1.5SetParam.CutOffDateequal to@DateTime.addToDate(param.StartDate,'','','','')
6.2Otherwise
6.2.1Setparam.StartDateequal to@addToDate(Param.DateGMT,'',14,'','')
6.2.2SetParam.PreviousBusinessDayStartDateequal to@addToDate(Param.PreviousBusinessDayGMT,'',14,'','')
6.2.3SetParam.PreviousBusinessDayEndDateequal to@DateTime.addToDate(param.PreviousBusinessDayStartDate,'1','','','')
6.2.4SetParam.PreviousDayequal to@DateTime.addToDate(param.StartDate,'-1','','','')
6.2.5SetParam.CutOffDateequal to@DateTime.addToDate(param.StartDate,'','','','')
7When@equalsIgnoreCase(Param.DateAEST,Param.DateGMT)
7.1When@equalsIgnoreCase(Param.DaylightSaving,true)
7.1.1Setparam.StartDateequal to@addToDate(Param.DateGMT,'',11,'','')
7.1.2SetParam.PreviousBusinessDayStartDateequal to@addToDate(Param.PreviousBusinessDayGMT,'',11,'','')
7.1.3SetParam.PreviousBusinessDayEndDateequal to@DateTime.addToDate(param.PreviousBusinessDayStartDate,'1','','','')
7.1.4SetParam.PreviousDayequal to@DateTime.addToDate(param.StartDate,'-1','','','')
7.1.5SetParam.CutOffDateequal to@DateTime.addToDate(param.StartDate,'','','','')
7.2Otherwise
7.2.1Setparam.StartDateequal to@addToDate(Param.DateGMT,'',10,'','')
7.2.2SetParam.PreviousBusinessDayStartDateequal to@addToDate(Param.PreviousBusinessDayGMT,'',10,'','')
7.2.3SetParam.PreviousBusinessDayEndDateequal to@DateTime.addToDate(param.PreviousBusinessDayStartDate,'1','','','')
7.2.4SetParam.PreviousDayequal to@DateTime.addToDate(param.StartDate,'-1','','','')
7.2.5SetParam.CutOffDateequal to@DateTime.addToDate(param.StartDate,'','','','')

Post a Comment