@@ -60,8 +60,8 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
6060 filename : `time-entries-${ formatDate ( new Date ( ) , 'MM_dd_yyyy-HH_mm' , 'en' ) } `
6161 } ,
6262 ] ,
63- columnDefs : [ { type : 'date' , targets : 2 } ] ,
64- order : [ [ 1 , 'asc' ] , [ 2 , 'desc' ] , [ 4 , 'desc' ] ]
63+ columnDefs : [ { type : 'date' , targets : 2 } ] ,
64+ order : [ [ 1 , 'asc' ] , [ 2 , 'desc' ] , [ 4 , 'desc' ] ]
6565 } ;
6666 dtTrigger : Subject < any > = new Subject ( ) ;
6767 @ViewChild ( DataTableDirective , { static : false } )
@@ -72,7 +72,7 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
7272 resultSum : TotalHours ;
7373 dateTimeOffset : ParseDateTimeOffset ;
7474
75- constructor ( private store : Store < EntryState > , private actionsSubject$ : ActionsSubject , private storeUser : Store < User > ) {
75+ constructor ( private store : Store < EntryState > , private actionsSubject$ : ActionsSubject , private storeUser : Store < User > ) {
7676 this . reportDataSource$ = this . store . pipe ( select ( getReportDataSource ) ) ;
7777 this . dateTimeOffset = new ParseDateTimeOffset ( ) ;
7878 }
@@ -128,28 +128,28 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
128128 const durationColumnIndex = 3 ;
129129 return column === durationColumnIndex ? moment . duration ( dataFormated ) . asHours ( ) . toFixed ( 2 ) : dataFormated ;
130130 }
131-
132- sumDates ( arrayData : Entry [ ] ) : TotalHours {
131+
132+ sumDates ( arrayData : Entry [ ] ) : TotalHours {
133133 this . resultSum = new TotalHours ( ) ;
134- let arrayDurations = new Array ( ) ;
135- arrayData . forEach ( entry => {
136- let start = moment ( entry . end_date ) . diff ( moment ( entry . start_date ) ) ;
137- arrayDurations . push ( moment . utc ( start ) . format ( " HH:mm:ss" ) ) ;
134+ const arrayDurations = new Array ( ) ;
135+ arrayData . forEach ( entry => {
136+ const start = moment ( entry . end_date ) . diff ( moment ( entry . start_date ) ) ;
137+ arrayDurations . push ( moment . utc ( start ) . format ( ' HH:mm:ss' ) ) ;
138138 } ) ;
139-
140- let totalDurations = arrayDurations . slice ( 1 )
141- . reduce ( ( prev , cur ) => {
142- return prev . add ( cur ) ;
143- } ,
144- moment . duration ( arrayDurations [ 0 ] ) ) ;
145- let daysInHours = totalDurations . days ( ) * 24 ;
146- this . resultSum . hours = totalDurations . hours ( ) + daysInHours ;
139+
140+ const totalDurations = arrayDurations . slice ( 1 )
141+ . reduce ( ( prev , cur ) => {
142+ return prev . add ( cur ) ;
143+ } ,
144+ moment . duration ( arrayDurations [ 0 ] ) ) ;
145+ const daysInHours = totalDurations . days ( ) * 24 ;
146+ this . resultSum . hours = totalDurations . hours ( ) + daysInHours ;
147147 this . resultSum . minutes = totalDurations . minutes ( ) ;
148148 this . resultSum . seconds = totalDurations . seconds ( ) ;
149149 return this . resultSum ;
150150 }
151151
152- user ( userId : string ) {
152+ user ( userId : string ) {
153153 this . selectedUserId . emit ( userId ) ;
154154 }
155155
0 commit comments