3
我有一個任務數組,每個任務都包含一個日期。我想強調datepicker中的匹配日期,但似乎無法在文檔中找到如何完成它。任何人都可以幫忙?Ng-Bootstrap Datepicker,如何突出顯示Angular4中的特定日期
https://ng-bootstrap.github.io/#/components/datepicker/api
這裏是我的打字稿:
import { Component, OnInit } from '@angular/core';
import {NgbDateStruct} from '@ng-bootstrap/ng-bootstrap';
const now = new Date();
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss']
})
export class DashboardComponent implements OnInit {
constructor() {
}
ngOnInit() {
}
model: NgbDateStruct;
date: {year: number, month: number};
selectToday() {
this.model = {year: now.getFullYear(), month: now.getMonth() + 1, day: now.getDate()};
}
}
和HTML:
<ngb-datepicker #dp [(ngModel)]="model" (navigate)="date = $event.next"></ngb-datepicker>