lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Quintiq file version 2.0
#parent: #root
Method DetermineEndOfEvent (
  DateTime start_i
) as DateTime id:Method_LibCal_GlobalState_DetermineEndOfEvent
{
  #keys: '[131094.1.1247783773]'
  Body:
  [*
    // Determine the endtime of an event based on the event's start_i.
    // Is implemented in this method so that it is possible to change the behavior in all relevant places
    // in the same way in one go by changing this method.
    end := start_i + Duration::Hours( 1 );
    
    // When running in days only mode, start_i is expected to be the start of a day.
    // The end is in that case the start of the next day, i.e. 1 day later.
    if( LibCal_Event::USE_ONLY_DAYS() )
    {
      end := start_i + Duration::Days( 1 );
    }
    
    return end;
  *]
}