From 847d995d851566318ee79b37762aef9644c42e82 Mon Sep 17 00:00:00 2001 From: zhangwen <1062680993@qq.com> Date: Tue, 20 Dec 2022 17:19:41 +0800 Subject: [PATCH 1/2] feat: support custom date point style #INFR-5801 --- .../app/gantt-custom-view/custom-day-view.ts | 12 ++++++++++++ packages/gantt/src/class/date-point.ts | 3 ++- .../calendar/calendar.component.html | 18 ++++++++++++++++-- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/example/src/app/gantt-custom-view/custom-day-view.ts b/example/src/app/gantt-custom-view/custom-day-view.ts index 51a1116e..ba10ca7a 100644 --- a/example/src/app/gantt-custom-view/custom-day-view.ts +++ b/example/src/app/gantt-custom-view/custom-day-view.ts @@ -77,6 +77,12 @@ export class GanttViewCustom extends GanttView { isToday: start.isToday() } ); + if (isWeekend) { + point.style = { fill: '#ff9f73' }; + } + if (start.isToday()) { + point.style = { fill: '#ff9f73' }; + } points.push(point); } if (!this.options.showWeekend) { @@ -106,6 +112,12 @@ export class GanttViewCustom extends GanttView { isToday: start.isToday() } ); + if (isWeekend) { + point.style = { fill: '#ff9f73' }; + } + if (start.isToday()) { + point.style = { fill: '#ff9f73' }; + } points.push(point); } diff --git a/packages/gantt/src/class/date-point.ts b/packages/gantt/src/class/date-point.ts index 7804ac9c..bfe41c39 100644 --- a/packages/gantt/src/class/date-point.ts +++ b/packages/gantt/src/class/date-point.ts @@ -9,6 +9,7 @@ export class GanttDatePoint { public additions?: { isWeekend: boolean; isToday: boolean; - } + }, + public style?: Partial ) {} } diff --git a/packages/gantt/src/components/calendar/calendar.component.html b/packages/gantt/src/components/calendar/calendar.component.html index 46d3e74c..577b8941 100644 --- a/packages/gantt/src/components/calendar/calendar.component.html +++ b/packages/gantt/src/components/calendar/calendar.component.html @@ -5,11 +5,25 @@ - + {{ point.text }} - + {{ point.text }} From 76eca50092fa4c4c482de2a7f4a3a5dc5307fc56 Mon Sep 17 00:00:00 2001 From: zhangwen <1062680993@qq.com> Date: Tue, 20 Dec 2022 18:07:13 +0800 Subject: [PATCH 2/2] fix: change secondary-text-today and primary-text-today to today --- .../gantt/src/components/calendar/calendar.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/gantt/src/components/calendar/calendar.component.html b/packages/gantt/src/components/calendar/calendar.component.html index 577b8941..5c472c02 100644 --- a/packages/gantt/src/components/calendar/calendar.component.html +++ b/packages/gantt/src/components/calendar/calendar.component.html @@ -8,7 +8,7 @@