ng2-ui / datetime-picker

Angular2 DateTime Picker
https://ng2-ui.github.io/#/datetime-picker
MIT License
121 stars 62 forks source link

Unable to set max-date #114

Closed pksatish07 closed 7 years ago

pksatish07 commented 7 years ago

Getting exception :

Cannot read property 'match' of undefined at Function.Ng2Datetime.removeTimezone (ng2-datetime.ts:156) at Function.Ng2Datetime.parse (ng2-datetime.ts:147) at Ng2DatetimePickerDirective.normalizeInput (ng2-datetime-picker.directive.ts:88) at Ng2DatetimePickerDirective.ngOnInit (ng2-datetime-picker.directive.ts:136)

Just went through the code. In below code you are refering to this.minDate which i think should be this.maxDate.

In ng2-datetime-picker.directive.ts:88

if (this.maxDate && typeof this.maxDate == 'string') { let d = Ng2Datetime.parseDate(this.minDate); this.maxDate = Number.isNaN(d.getTime()) ? new Date() : d; }

pksatish07 commented 7 years ago

I was able to set max date but still could you please still check if date should be this.maxDate??