I am currently facing an issue while trying to set a const exported function in a material datepicker filter with parameters. When I try to set the parameters in my component, the function gets executed and returns the result (a boolean) instead of simply setting the function definition for my datepicker filter. Can anyone provide me with a solution or an alternative approach to resolve this issue? Thank you for your assistance.
Here is the exported function:
export const daysFunction = (d: Date, days: any): boolean => {
if (days) {
return true;
} else {
return false;
}
};
Within my component:
daysFunction = daysFunction(null, days); // This line triggers the execution of my function