lazhen
2024-05-30 7ba9073f61f44b41b941ab6ee732d02b47b988f4
_Main/BL/Type_LibCal_SubscriberEventTable/Method_InitializeMonth.qbl
@@ -4,7 +4,8 @@
  LibCal_SubscriberEventTable table,
  LibCal_SubscriberEventRow row,
  DateTime starttime,
  DateTime endtime
  DateTime endtime,
  String desc
)
{
  TextBody:
@@ -20,13 +21,22 @@
        column := table.LibCal_SubscriberEventColumn( relnew, Name := time.Format( 'M/D/Y' ), Period := time.Date() );
      }
      
      duration := startTime.StartOfNextMonth() - startTime;
      if( startTime.StartOfNextMonth() > endtime ){
        duration := endtime - startTime;
        cell := column.LibCal_SubscriberEventCell( relnew, Value := [String]duration.HoursAsReal()
                                                   , Start := startTime.Format( 'M/D/Y H:m' )
                                                   , End := endtime.Format( 'M/D/Y H:m' )
                                                   , Description := desc );
        row.LibCal_SubscriberEventCell( relinsert, cell );
      }else{
        duration := startTime.StartOfNextMonth() - startTime;
        cell := column.LibCal_SubscriberEventCell( relnew, Value := [String]duration.HoursAsReal()
                                                   , Start := startTime.Format( 'M/D/Y H:m' )
                                                   , End := startTime.StartOfNextMonth().Format( 'M/D/Y H:m' )
                                                   , Description := desc );
        row.LibCal_SubscriberEventCell( relinsert, cell );
      }
    //  info( startTime, column.Name(), duration.AsQUILL(), duration.HoursAsReal() );
      cell := column.LibCal_SubscriberEventCell( relnew, Value := [String]duration.HoursAsReal() );
      row.LibCal_SubscriberEventCell( relinsert, cell );
    }
  *]
}