Datetime picker (plugins wrapper) for Angular.
Demo and docs: https://nkalinov.github.io/ng2-datetime
- Bootstrap3 (CSS only)
- jQuery 2+ (supports v3)
- Bootstrap-datepicker (JS+CSS)
- Bootstrap-timepicker (JS+CSS)
npm install --save ng2-datetime
If your project does not use jQuery yet, add the required jQuery packages as well:
npm install jquery --save
npm install @types/jquery --save
-
import some way or another the required dependencies in the following order:
- Bootstrap CSS
- jQuery
- bootstrap-timepicker + bootstrap-datepicker
See this example
-
import { NKDatetimeModule } from 'ng2-datetime/ng2-datetime';
-
Add it to your app module's
imports
property
@NgModule({
...
imports: [NKDatetimeModule, ...],
...
})
- Use it:
<datetime [(ngModel)]="date"></datetime>
See the DEMO and it source for more info and available options.
Fork > Create > Pull request
- @jdewit for the timepicker plugin
- @eternicode for the datepicker plugin
- you