Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed Jun 17, 2023
1 parent bde4ca5 commit 26b911f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ export class ScDateTimeChartBase {
}
this.localStart = this.localItems
.map((myItem) => myItem.start)
.filter((myStart) => !!myStart)
.reduce(
(acc, myItem) => (myItem.valueOf() < acc.valueOf() ? myItem : acc),
(acc, myItem) =>
(myItem as ChartItem<Event>).valueOf() <

Check failure on line 41 in projects/ngx-simple-charts/date-time/src/lib/sc-date-time-chart/sc-date-time-chart-base.ts

View workflow job for this annotation

GitHub Actions / Analyze (javascript)

Conversion of type 'Date | null' to type 'ChartItem<Event>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
(acc as ChartItem<Event>).valueOf()

Check failure on line 42 in projects/ngx-simple-charts/date-time/src/lib/sc-date-time-chart/sc-date-time-chart-base.ts

View workflow job for this annotation

GitHub Actions / Analyze (javascript)

Conversion of type 'Date | null' to type 'ChartItem<Event>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
? myItem
: acc,
new Date()
);
) as Date;
//console.log(this.localStart);
const startOfChart = DateTime.fromJSDate(this.localStart)
.setLocale(this.locale)
Expand All @@ -56,14 +61,16 @@ export class ScDateTimeChartBase {
.toJSDate();
const lastEndItem = this.localItems.reduce(
(acc, newItem) =>
acc?.end?.valueOf() < newItem?.end?.valueOf() ? newItem : acc,
!!newItem && acc?.end?.valueOf() < newItem?.end?.valueOf()

Check failure on line 64 in projects/ngx-simple-charts/date-time/src/lib/sc-date-time-chart/sc-date-time-chart-base.ts

View workflow job for this annotation

GitHub Actions / Analyze (javascript)

Object is possibly 'undefined'.

Check failure on line 64 in projects/ngx-simple-charts/date-time/src/lib/sc-date-time-chart/sc-date-time-chart-base.ts

View workflow job for this annotation

GitHub Actions / Analyze (javascript)

Object is possibly 'undefined'.
? newItem
: acc,
myItem
);
const openEndItems = this.localItems.filter((newItem) => !newItem?.end);
this.end =
openEndItems.length > 0 || !this.localShowDays
? endOfYear
: lastEndItem.end.getFullYear() < 1
: !!lastEndItem && lastEndItem?.end?.getFullYear() < 1

Check failure on line 73 in projects/ngx-simple-charts/date-time/src/lib/sc-date-time-chart/sc-date-time-chart-base.ts

View workflow job for this annotation

GitHub Actions / Analyze (javascript)

Object is possibly 'undefined'.
? endOfYear
: lastEndItem.end;
this.periodDays = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class ScDateTimeChartComponent
}

protected calcStartPxItem(item: ChartItem<Event>): number {
return this.calcStartPx(item.start);
return this.calcStartPx(item.start as Date);
}

protected calcEndPxItem(item: ChartItem<Event>): number {
Expand Down

0 comments on commit 26b911f

Please sign in to comment.