Looking for guidance on utilizing the
eonasdan-bootstrap-datetimepicker
library in conjunction with Angular 6? Want to establish default options?
Access the library at: https://github.com/Eonasdan/bootstrap-datetimepicker
Provided below is the code snippet:
import * as $ from 'jquery';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
constructor() {
$.fn.datetimepicker.defaults.keepInvalid = true;
$.fn.datetimepicker.defaults.useStrict = true;
$.fn.datetimepicker.defaults.useCurrent = false;
$.fn.datetimepicker.defaults.format = "MM/DD/YYYY";
$.fn.datetimepicker.defaults.keyBinds["delete"] = null;
$.fn.datetimepicker.defaults.icons = {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-angle-up',
down: 'fa fa-angle-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'glyphicon glyphicon-screenshot',
clear: 'fa fa-trash-o',
close: 'fa fa-window-close'
}
}
}
Encountering the following error message:
Property 'datetimepicker' does not exist on type 'JQuery<HTMLElement>'