I'm confusing everything so rephrasing entire question:
I have 2 arrays. The var personalEntries: Entrymodel[] = [];
and specialDates : Specialdates[] = [];
I Break down personalEntries untill it shares a format with specialDates
This format being MM/DD or 1201,1202,1203,1204
I have a ban Period of specific holidays Which is 4 years.
I now need to see weather my broken down array personalInbet
var personalInbet : any[] = [];
personalEntries.forEach(az => {
az.inbet.forEach(i => {
var x = (i.month+"-"+i.day+"-"+i.year);
personalInbet.push(x);
});
});
Shares dates with specialDates. This I can do
by using something like:
const result = this.personalInbet.filter(d => !this.specialDates.includes(d));
The Issue I have:
Is checking weather the users holiday dates are within the 4 year Ban period.
Now the only way I can think to do this is something kinda like this: its just a logical example Im ignoring any and all langue out of it
var x = if(personalInbetween has duplicates in specialDates){
if(x.year > 4)//Just a logical example Id need to see that the users dates fall into the specialdates and then access those user dates to get the year and then see if the year is below or over the ban period which is 4
{
//NoGO
}
else{
go
}
The main problem here being that SpecialDates only has Months,Days
And the users bookings has Days/Months/Years
So to compare the two arrays they need to be similar in values, But when they are I no longer have access to the years So i can see if the years are > 4