Datepicker will help you with date selection. It can be used either inline with NgbDatepicker component or as a popup on any input element with NgbInputDatepicker directive. It also comes with the list of services to do date formatting, i18n and alternative calendars support.
We try to keep API of our components simple, but introduce extension points, so you could enrich and reuse them. Here is a short example of the vacation range picker that displays holidays with tooltips and disables weekends.
Basic Usage
Datepicker can be used either inline or inside of the popup.
<!-- 1. inline datepicker -->
<ngb-datepicker #d></ngb-datepicker>
<!-- 2. datepicker in the popup -->
<input type="text" ngbDatepicker #d="ngbDatepicker"/>
In the example above the template variable #d will point to the instance of the NgbDatepicker component in the first case. In the second it will point to the instance of the NgbInputDatepicker directive that handles the popup with inline datepicker component.
See the NgbDatepicker API and the NgbInputDatepicker API for details on available inputs, outputs and methods. You can customize the number of displayed months, the way navigation between months and years looks like, week numbers, etc.
If you have a very specific use case for the datepicker popup, you could always create you own one and use the inline datepicker inside.
Comments
Post a Comment