【发布时间】:2018-08-10 07:41:03
【问题描述】:
我正在使用 Angular 日历(在此处查看演示 https://mattlewis92.github.io/angular-calendar/#/kitchen-sink)
我需要在我选择的一天(或更多天)申请不同的课程。 所以,如果我点击一天(或更多),我需要它们是粉红色的。
我对今天的细胞做了类似的事情
const today_cell: 'today-cell' = 'today-cell';
export class MonthCalendarComponent implements OnInit {
todayCssClass: string = today_cell;
beforeMonthViewRender({ body }: { body: CalendarMonthViewDay[] }): void {
body.forEach(day => {
if (day.isToday === true) {
day.cssClass = this.todayCssClass;
}
}
}
但我没有使用点击事件。我该怎么做?
【问题讨论】:
-
您是想选择日期,还是只在您点击一次的每一天应用不同的格式,之后不再对那些日子做任何事情?
-
选择了几天后,我会将它们发送到数据库,所以我需要保存它们