primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Calendar issue min/maxDate - beta19

Open moxival opened this issue 10 years ago • 4 comments

When changing the minDate or maxDate (bound) the UI does not respond to that unless you navigate to the next/prev month.

Example:

import { Component} from '@angular/core';

@Component({
  selector    : 'app-test',
  templateUrl : './test.component.html'
})
export class TestComponent {
 startDate: Date;
  endDate: Date;
  constructor(public err: ErrorsService) {
    this.startDate = new Date('2016-10-10T00:00:00.000Z');
    this.endDate = new Date('2018-10-15T00:00:00.000Z');
  }
}
<b>Start:</b> {{startDate}} <b>End:</b> {{endDate}} <br>
Start <p-calendar [(ngModel)]="startDate" [maxDate]="endDate"></p-calendar><br>
End <p-calendar [(ngModel)]="endDate" [minDate]="startDate"></p-calendar>

image

maxDate of startDate is not visualised at all but should be the value of endDate

image

minDate of endDate is still 10/10 which was the initial value of startDate

If however i do navigate to the next month and come back to the current one (where the selected dates are) everything is ok:

image

moxival avatar Oct 24 '16 11:10 moxival

Same behaviour in beta20

moxival avatar Oct 26 '16 06:10 moxival

This should be fixed in recent PrimeNG release, please try with it and if the issue persists drop a comment with along with a test case based on plunkr below and we'll review again.

http://plnkr.co/edit/VZbdZfQ7SuTV87tTkbYR

cagataycivici avatar Jun 06 '17 13:06 cagataycivici

The same incorrect behavior in 5.0.2.

jevgenimarenkov avatar Jan 03 '18 14:01 jevgenimarenkov

Initially thumbs up this as I believed it wasn't fixed. I was wrong & was using

maxDate='experienceForm.value.endDate' instead of [maxDate]='experienceForm.value.endDate'

Hope this simple mistake helps others.

JamboBuenna avatar Feb 07 '18 08:02 JamboBuenna