Open GlennVanSchil opened 6 years ago
I'm using this:
//in import section
declare var $ :any;
//in class declaration
@ViewChild('dateInputFrom') dateInputFrom;
//using in method
$(this.dateInputFrom.nativeElement).pickadate('picker').set('min',new Date());
//in template
<input type="text" class="datepicker" #dateInputFrom formControlName="..." materialize="pickadate" [materializeParams]="[datePickerFromParams]">
corespond to: http://amsul.ca/pickadate.js/api/#method-set-max
I've already looked at https://github.com/InfomediaLtd/angular2-materialize/issues/393, https://github.com/InfomediaLtd/angular2-materialize/issues/280, https://github.com/InfomediaLtd/angular2-materialize/issues/279 and https://github.com/InfomediaLtd/angular2-materialize/issues/127 but I'm still unable to get this to work. I've seen multiple solutions in these posts such as using ngIf to reload it etc. but this doesn't work for me either. My use case is the following.
I Have two dates
from
andto
.from
's max value isto
's current value,to
's min value isfrom
's current value. When I first set the default dates it works fine, but when I change one of them it just keeps the original optionsHTML
Typescript
The thing I've tried so far are:
Is there a, preferably not a hacky, solution for this problem?