Question Shubhendu Pattnaik · Feb 1, 2022

Date Difference

I am having a scenario where I need to check difference between current date and a past date should be less than 31 in Routing Rule. Can anybody help me how to code that?

Comments

Satya Prasad Kalam · Feb 6, 2022

Here is the custom class for this...

You should add this in one of your custom class which Extends Ens.Rule.FunctionSet so that it is visible in Routing Rule. 

ClassMethod DaysFromToday(pDate As %String) As %Integer
{
    Set tNow = $H+0
    Return $ZDATEH($EXTRACT(pDate,1,8),8) - tNow
}

I got this from Jeffrey Drumm. 

0