Quintiq file version 2.0
#parent: #root
Method SetDateTime () id:Method_DialogCreateEditUnit_SetDateTime
{
  #keys: '[11660.0.1349222660]'
  Body:
  [*
    // Set date time
    
    if ( CheckBoxHasStart.Checked() and not GUIDateTimeSelectorStart.DateTime().Date().IsFinite() )
    {
      start := MacroPlan.Start();
    
      if ( CheckBoxParent.Checked() 
           and not isnull( SelectionParent.Data() )
           and SelectionParent.Data().StartDate().IsFinite() )
      {
        start := SelectionParent.Data().StartDate().DateTime();
      }
      
      GUIDateTimeSelectorStart.DateTime( start );
    }
    
    if ( CheckBoxHasEnd.Checked() and not GUIDateTimeSelectorEnd.DateTime().Date().IsFinite() )
    {
      end := MacroPlan.End();
    
      if ( CheckBoxParent.Checked() 
           and not isnull( SelectionParent.Data() )
           and SelectionParent.Data().StartDate().IsFinite() )
      {
        end := SelectionParent.Data().EndDate().DateTime();
      }
      
      GUIDateTimeSelectorEnd.DateTime( end  );
    }
  *]
}
