Quintiq file version 2.0
#parent: #root
Method EnableDaysOnlyMode () id:Method_LibCal_dlgEditTimeInterval_EnableDaysOnlyMode
{
  #keys: '[150080.0.514092931]'
  Body:
  [*
    // Hide start and end time, and checkbox 'All day'
    durStartTimeOfDay.Visible( false );
    durEndTimeOfDay  .Visible( false );
    ckbIsAllDay      .Visible( false );
    
    // Additionally: change label from 'Start time' to 'Start',
    //               hide end, and show the applicable controls for the duration.
    dsStartDate.Label( "Start" );
    dsEndDate  .Visible( false );
    valDuration.Visible( false );
    npDuration .Visible( true  );
    lblDays    .Visible( true  );
    
    // Just to be sure: make sure the times are 0:00
    // (in case an occurrence is edited that was created when days only more was turned off).
    durStartTimeOfDay.Duration( Duration::Zero() );
    if( durEndTimeOfDay.Duration() > Duration::Zero() )
    {
      dsEndDate.Date( dsEndDate.Date() + 1 );
      durEndTimeOfDay.Duration( Duration::Zero() );
    }
  *]
}
