Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
resolved conflicts
  • Loading branch information
wilc0519 committed Jul 18, 2022
commit e49cc4333cf9bf1c98917b7d87e8b2ff71bbae2a
2 changes: 0 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatInputModule } from '@angular/material/input';
import { MatIconModule } from '@angular/material/icon';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatListModule } from '@angular/material/list';
import { MatMomentDateModule } from '@angular/material-moment-adapter';
import { NgxPaginationModule } from 'ngx-pagination';
Expand Down Expand Up @@ -178,7 +177,6 @@ const maskConfig: Partial<IConfig> = {
UiSwitchModule,
DragDropModule,
MatIconModule,
MatCheckboxModule,
MatListModule,
StoreModule.forRoot(reducers, {
metaReducers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,21 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
return column === durationColumnIndex ? moment.duration(dataFormated).asHours().toFixed(2) : dataFormated;
}

sumDates(arrayData: Entry[]): TotalHours{
sumDates(arrayData: Entry[]): TotalHours {
this.resultSum = new TotalHours();
const arrayDurations = new Array();
arrayData.forEach(entry => {
const start = moment(entry.end_date).diff(moment(entry.start_date));
arrayDurations.push(moment.utc(start).format('HH:mm:ss'));
});

let totalDurations = arrayDurations.slice(1)
.reduce((prev, cur) => {
return prev.add(cur);
},
moment.duration(arrayDurations[0]));
let daysInHours = totalDurations.days() * 24;
this.resultSum.hours=totalDurations.hours() + daysInHours;
const totalDurations = arrayDurations.slice(1)
.reduce((prev, cur) => {
return prev.add(cur);
},
moment.duration(arrayDurations[0]));
const daysInHours = totalDurations.days() * 24;
this.resultSum.hours = totalDurations.hours() + daysInHours;
this.resultSum.minutes = totalDurations.minutes();
this.resultSum.seconds = totalDurations.seconds();
return this.resultSum;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.