bleenco / ng2-datepicker

Angular2 Datepicker Component
http://ng2-datepicker.jankuri.com
MIT License
311 stars 236 forks source link

Bugfix/incorrect min max #359

Closed yadue closed 3 years ago

yadue commented 3 years ago

Min max options are working incorrectly:

If I set

minDate -> 15.06.2021, then it allows to select 01.06-15.06. First argument should be date, not this.options.minDate. Same situation for maxDate.

  private isDateSelectable(date: Date): boolean {
    if (this.options.minDate && isBefore(this.options.minDate, date)) {
      return false;    
    }
    if (this.options.maxDate && isAfter(this.options.maxDate, date)) {
      return false;
    }
    return true;
  }

This PR fixes it.

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

jkuri commented 3 years ago

and please keep package-lock.json file, also rebase against current master otherwise I cannot merge it.

yadue commented 3 years ago

@jkuri can you publish npm package? Thanks in advance

jkuri commented 3 years ago

@yadue already done.