Skip to content
Merged
Changes from all commits
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
5 changes: 3 additions & 2 deletions src/time-range/time-range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export class TimeRange {
if (prevSection.end >= v.start) {
prevSection.end = v.end > prevSection.end ? v.end : prevSection.end;
prevSection.interval = decimalRoundDown(
decimalRoundUp(prevSection.interval, this.decimalPlaces) + decimalRoundUp(v.interval, this.decimalPlaces),
decimalRoundUp(prevSection.interval ?? 0, this.decimalPlaces) +
decimalRoundUp(v.interval ?? 0, this.decimalPlaces),
this.decimalPlaces
);
} else {
Expand All @@ -76,7 +77,7 @@ export class TimeRange {

totalInterval() {
const result = this.section.reduce((p, v) => {
const interval = decimalRoundUp(v.interval, this.decimalPlaces);
const interval = decimalRoundUp(v.interval ?? 0, this.decimalPlaces);

//XXX: 반올림 때문에 interval이 end-start보다 작은 경우가 있음
const end = decimalRoundUp(v.end, this.decimalPlaces);
Expand Down