Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method InitializeDay ( 
 | 
  LibCal_SubscriberEventTable table, 
 | 
  LibCal_SubscriberEventRow row, 
 | 
  DateTime starttime, 
 | 
  DateTime endtime, 
 | 
  String desc 
 | 
) 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    // 甄兰鸽 May-29-2024 (created) 
 | 
    for(  startTime := starttime; startTime < endtime; startTime := startTime.StartOfNextDay() ){ 
 | 
      time := startTime.Format( 'M/D/Y' ); 
 | 
      column := selectobject( table, LibCal_SubscriberEventColumn, column, column.Name() = time ); 
 | 
      if( isnull( column ) ){ 
 | 
        column := table.LibCal_SubscriberEventColumn( relnew, Name := time, Period := startTime.Date() ); 
 | 
      } 
 | 
       
 | 
      if( startTime.StartOfNextDay() > endtime ){ 
 | 
        duration := endtime - startTime; 
 | 
        cell := column.LibCal_SubscriberEventCell( relnew, Value := [String]duration.HoursAsReal() 
 | 
                                                   , Description := desc ); 
 | 
        cell.Period( relnew, Start := startTime.Format( 'M/D/Y H:m' ), End := endtime.Format( 'M/D/Y H:m' ) ); 
 | 
        row.LibCal_SubscriberEventCell( relinsert, cell ); 
 | 
      }else{ 
 | 
        duration := startTime.StartOfNextDay() - startTime; 
 | 
        cell := column.LibCal_SubscriberEventCell( relnew, Value := [String]duration.HoursAsReal() 
 | 
                                                   , Description := desc ); 
 | 
        cell.Period( relnew, Start := startTime.Format( 'M/D/Y H:m' ), End := startTime.StartOfNextDay().Format( 'M/D/Y H:m' ) ); 
 | 
        row.LibCal_SubscriberEventCell( relinsert, cell ); 
 | 
      } 
 | 
    //  info( startTime, column.Name(), duration.AsQUILL(), duration.HoursAsReal() ); 
 | 
    } 
 | 
  *] 
 | 
} 
 |