user2023861
user2023861

Reputation: 8208

How do I set the startDate in an Angular-Bootstrap ngb-datepicker

I want to use a ngb-datepicker in my application. According to this documentation, this compnent has a startDate input that controls the initial date of the calendar. I can't figure out how to set this date. Since there are no examples using this input, I have to guess. I've tried each of these lines, but they don't work.

  1. <ngb-datepicker startDate="2018-11-01"></ngb-datepicker>
  2. <ngb-datepicker startDate="{ year: 2018; month: 11; }"></ngb-datepicker>
  3. <ngb-datepicker startDate.year="2018" startDate.month="11"></ngb-datepicker>

How do I do this?>

Upvotes: 0

Views: 2947

Answers (1)

David Anthony Acosta
David Anthony Acosta

Reputation: 4890

They do show it in the documentation. It's in the Overview section, the "Move Around" subparagraph. And it's like this:

<ngb-datepicker [startDate]="{year: 2018, month: 11}"

Upvotes: 3

Related Questions