Question
Shubhendu Pattnaik · Feb 1

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?

0
0 165
Discussion (2)1
Log in or sign up to continue

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.