Highlighted
Trusted Contributor.. Trusted Contributor..
Trusted Contributor..
309 views

How to calculate the business days and hours in a datetime type Array field.

Hi There,

We are using RAD application "calendar.calc.date.fc" to calculate time duration in formatctrl.

There is two datetime type array field 

Outage.start[] and Outage.end[] 

and now we want to capture the business time duration in another datetime type array field name as downtime[]

Looking for the response. Thanks in advance

 

0 Likes
1 Reply
Highlighted
Honored Contributor.
Honored Contributor.

Re: How to calculate the business days and hours in a datetime type Array field.

Hi,

we used a different RAD-Call from JS for calculating the duration:

 

   var rteReturnValue = new SCDatum();
   var Names = new SCDatum();
   var Vals = new SCDatum();
   var rec = new SCFile("ticketstats");
   Names.setType(8);//type array
   Vals.setType(8);//type array
   Names.push("file");
   Names.push("name");
   Names.push("times,1");
   Names.push("times,2");
   Names.push("prompt");
   Vals.push(rec);
   Vals.push("ticket.duration"); //any Date/Time field name, but not an array field
   Vals.push(start); // start value from a Date/Time field
   Vals.push(end); // end value from a Date/Time field
   Vals.push("24x7"); // name of caldutyhours
   var rc = system.functions.rtecall("callrad", rteReturnValue, "calendar.calc.interval.fc", Names, Vals, false);

The result of the calculation is in the target field (here: ticket.duration). Unfortunately all the fields we used are not array fields...but maybe it's a good starting point...

Greetings,

Bo

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.