haorenhui
2023-10-30 6d6cc10d9e8e242661da7fd655dec155a09d676c
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
27
28
29
30
31
32
Quintiq file version 2.0
#parent: #root
Method OnOK () id:Method_LibCal_dlgEditTimeInterval_OnOK
{
  #keys: '[146730.0.1319603118]'
  Body:
  [*
    timezone := Form.GetCalendarTimeZone();
    
    startDate      := dsStartDate.Date();
    endDate        := dsEndDate  .Date();
    startTimeOfDay := durStartTimeOfDay.Duration();
    endTimeOfDay   := durEndTimeOfDay  .Duration();
    
    // When running in days only mode, use the number of days from the NumberPicker to calculate the end date.
    // Set the times to 0:00 (just to be sure).
    if( LibCal_Event::USE_ONLY_DAYS() )
    {
      endDate        := startDate + [Number]npDuration.Number();
      endTimeOfDay   := Duration::Zero();
      startTimeOfDay := Duration::Zero();
    }
    
    startTime := startDate.DateTime( timezone ).AddAsPeriod( timezone, startTimeOfDay );
    endTime   := endDate  .DateTime( timezone ).AddAsPeriod( timezone, endTimeOfDay   );
    
    eti := dhExplicitTimeInterval.Data().WrappedInstance().astype( LibCal_ExplicitTimeInterval );
    eti.Update( startTime, endTime, edtComment.Text() );
    
    Form.Close();
  *]
}