fetrarij / ngx-daterangepicker-material

Pure Angular 2+ date range picker with material design theme, a demo here:
https://fetrarij.github.io/ngx-daterangepicker-material/
MIT License
249 stars 252 forks source link

Ranges are not updated #387

Closed gcherem closed 3 years ago

gcherem commented 3 years ago

Versions

Describe the bug Ranges labels are not updated after changing in ranges array.

To Reproduce Steps to reproduce the behavior:

I have the component declared like this in a reactive form:

    <input
      type="text"
      name="calendar"
      opens="left"
      matInput
      ngxDaterangepickerMd
      [(ngModel)]="selectedDate"
      class="form-control"
      [locale]="locale"
      [showRangeLabelOnInput]="true"
      [alwaysShowCalendars]="true"
      [showDropdowns]="true"
      [ranges]="ranges"
      (datesUpdated)="onChangeCalendar($event)"
    />

Since the user can change the language (i18n) on the fly, I recalculate the ranges array with the new labels, but the component is not updated.

Expected behavior Calendar and placeholder labels automatically updated as the ranges get updated.

gcherem commented 3 years ago

Worked after update for v5