data collection error i am using pa script to find the diffrence of two fields

sasharma815
Tera Contributor

What i am trying to do is find the difference of two fields  time event starts and time event ends both are in string format value is 6am and 5pm now for calculation of diffrence of these two and find the hours in between them i have written a script which is throwing this error can anyone tell me what can be the possible reason for it 

 

 

Script -    

var gd = new GlideDateTime(current.value);
// var gc = new GlideDateTime(current.time_event_ends);

var diff=function(x,y){return y.dateNumericValue() - x.dateNumericValue();};
var time=function(x,y){return diff(x,y)/(24*60*60*1000);};
days(current.value,score_ends);

 

Error -  during JavaScript evaluation: Not all references of "current" are passed in by "arguments" script: var gd = new GlideDateTime(current.time_event_starts); var gc = new GlideDateTime(current.time_event_ends); var diff=function(x,y){return y.dateNumericValue() - x.dateNumericValue();}; var days=function(x,y){return diff(x,y)/(24*60*60*1000);}; days(current.time_event_starts,current.time_event_ends);  

0 REPLIES 0