Skip to content

Commit

Permalink
fix(schedule): fix time expanded not show in schedule #6
Browse files Browse the repository at this point in the history
  • Loading branch information
abalad committed Oct 28, 2020
1 parent 874f8a3 commit bc37bb2
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,15 @@ export class ViewDayComponent implements OnInit, AfterViewInit, OnChanges, OnDes
const notExpansedScales = orderedScales.filter( (scale) => !scale.expansed );
const beforeHourScale = this.reduceBeforeScale( orderedScales );
const afterHourScale = this.reduceAfterScale( orderedScales );
return this.sortScaleByStart(notExpansedScales.concat(afterHourScale).concat(beforeHourScale));
return this.sortScaleByStart(
this.removeSameStartAndEndSacalesTime(
notExpansedScales.concat(afterHourScale).concat(beforeHourScale)
)
);
}

private removeSameStartAndEndSacalesTime(scales: WorkScaleType[]) {
return scales.filter( (value => value.start !== value.end ));
}

private reduceBeforeScale( scales: WorkScaleType[] ) {
Expand Down

0 comments on commit bc37bb2

Please sign in to comment.