3

ng2-datepicker how to set date manually?

<ng2-datepicker [(ngModel)]="date" [options]="options"
(outputEvents)="handleDateChange($event,date)"></ng2-datepicker>

datepicker.component.ts

options: DatePickerOptions = {
        initialDate: new Date(),
        autoApply: true
    };

from typescript code how to set date picker date to next date or previous date etc.

I tried ng2-datepicker issue but it's not working.

Pratap A.K
  • 4,337
  • 11
  • 42
  • 79
  • What do you mean by setting date manually? Is it like giving the user the option to write the date and it should be reflected on the datepicker? or initialize the datepicker to start from a specific date ? or ? – Oussa May 11 '17 at 11:13
  • @theZaki giving the option to write the date and it should reflecte on the datepicker. – Pratap A.K May 11 '17 at 11:26
  • I checked the [ng2-datepicker repo](https://github.com/jkuri/ng2-datepicker), appenrently the feature is not supported, so I opened a [PR](https://github.com/jkuri/ng2-datepicker/pull/230) for that. – Oussa May 11 '17 at 13:55
  • @theZaki thank you very much – Pratap A.K May 11 '17 at 17:49

0 Answers0