admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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 DetermineStartOfEvent (
  DateTime baseTime_i,
  TimeZone timezone_i
) as DateTime id:Method_LibCal_GlobalState_DetermineStartOfEvent
{
  #keys: '[131094.1.1247784008]'
  Body:
  [*
    // Determine the starttime of an event based on a baseTime_i (for example a ContextMenuTime).
    // 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.
    start := baseTime_i.Round( Duration::Minutes( 30 ) );
    
    // When running in days only mode, set the start to the start of the day.
    if( LibCal_Event::USE_ONLY_DAYS() )
    {
      start := start.StartOfDay( timezone_i );
    }
    
    return start;
  *]
}