Ng-Bootstrap Datepicker, how to highlight specific days in Angular4

Viewed 6145

I have an array of tasks, each contains a date. I would like to highlight the matching days in the datepicker but cannot seem to find in the documentation how to accomplish it. Anyone able to help?

https://ng-bootstrap.github.io/#/components/datepicker/api

Here is my typescript:

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()};
  } 
}

And Html:

<ngb-datepicker #dp [(ngModel)]="model" (navigate)="date = $event.next"></ngb-datepicker>
1 Answers
Related