How do you calculate dates in LPL
Something like the difference between Start Date till end of year of start date.
Say the start date is 1/Dec/2020 then the number of days output should be 31 (31-Dec-2020 - 1-dec-2020 +1) else it should be 365 if start date not in current year
I would create a compute field that auto computes the difference between end of year and start date if in current year in days else it should be 365 if start date is not in current year
The equivalent of the below IPA javascript code
(StartDate.substring(0,4)==todayAGS().substring(0,4))?(DateDiff(pfDate(StartDate.substring(0,4)+"1231",'yyyymmdd'),pfDate(StartDate,'yyyymmdd'))+1 ):365