I'm working with this component example: link
I need to add three features.
The first I believe to have to do with the class, as in this example , if the day is out of the minimum date or maximum allowed, the day would be "off", with a different coloration. My attempts to reproduce the above example were all flawed.
It should look like this:
Thesecondfeaturewouldbetocallthedatapickeronlywhenabuttonwasclicked.
Andthethirdfeaturehastodowithbusinessrule,whenthe"dateFrom", I would like to change the setting so that it allows you to select the "dateTo" for a maximum of one month from the date selected in dateFrom.
I tried to do the following:
onDateSelection(date: NgbDateStruct, config: NgbDatepickerConfig) {
if (!this.fromDate && !this.toDate) {
this.fromDate = date;
config.maxDate = {year: date.year, month: date.month + 1, day: date.day};
} else if (this.fromDate && !this.toDate && after(date, this.fromDate)) {
this.toDate = date;
} else {
this.toDate = null;
this.fromDate = date;
config.maxDate = {year: date.year, month: date.month + 1, day: date.day};
}
}
But I get the following error:
ERROR Error: Can not set property 'maxDate' of undefined
This can also be seen at link