hongji.li
2023-11-07 1a1ba3ad5ed9e4380185aa1ccad20204a0e5f115
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Quintiq file version 2.0
#parent: #root
Method PTF_GetTotalDuration (
  String startdatetimestring,
  String enddatetimestring
) as String id:Method_LibPTF_pnlTestController_PTF_GetTotalDuration
{
  #keys: '[103546.0.77946659]'
  Body:
  [*
    // Calculate the duration from the start and end time supplied
    result := Duration::Zero();
    
    if( startdatetimestring <> "" and startdatetimestring <> "N/A"
        and enddatetimestring <> "" and enddatetimestring <> "N/A"
      )
    {
      startdatetime := LibPTF_pnlTestController.PTF_ConvertStringToDateTime( startdatetimestring );
      enddatetime   := LibPTF_pnlTestController.PTF_ConvertStringToDateTime( enddatetimestring );
    
      result := enddatetime - startdatetime
    }
    
    return [String]result;
  *]
}