Angular 5 ng2-datepicker Date Picker Days are missing

1k Views Asked by At

Suggest me a Date Picker compared to Angular 5

DatePicker coming but not showing dates for the first time onloading.

only showing weeks. when I click next month arrow then it's showing properly

app.module.ts

import { NgDatepickerModule  } from 'ng2-datepicker';

@NgModule({
 imports: [
   NgDatepickerModule
   ]
});

component.ts

import { DatepickerOptions } from 'ng2-datepicker';

componet.html

<ng-datepicker formControlName="callDate"></ng-datepicker>
2

There are 2 best solutions below

0
Victor Luchian On

Try using the Datepicker from ngx-bootstrap. It has a lot of configuration and it works with angular 5.

0
Sekar On
HTML Code:
<form class="form-inline">
<div class="form-group">
<div class="input-group">
<input class="form-control" placeholder="yyyy-mm-dd"
         name="dp" [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker">
<div class="input-group-append">
<button class="btn btn-outline-secondary" (click)="d.toggle()" type="button">
<img src="img/calendar-icon.svg" style="width: 1.2rem; height: 1rem; cursor: 
 pointer;"/>
</button>
 </div>
 </div>
 </div>
 </form>


 Ts Code is:
 import {Component} from '@angular/core';

 @Component({
 selector: 'ngbd-datepicker-popup',
 templateUrl: './datepicker-popup.html'
 })
 export class NgbdDatepickerPopup {
    model;
 }