Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public setFilter(startDate: Date, endDate: Date): void {
const filter = new AdvancedFilter(
{
column: "Test",
table: "Demo",
},
"And",
{
operator: "GreaterThanOrEqual",
value: startDate,
},
{
operator: "LessThanOrEqual",
value: endDate,
},
);
this.jsonFilters = [filter];
public createFilter(startDate: Date, endDate: Date, target: IFilterColumnTarget): AdvancedFilter {
if (startDate == null || endDate == null || !target) {
return null;
}
return new AdvancedFilter(
target,
"And",
{
operator: "GreaterThanOrEqual",
value: startDate.toJSON(),
},
{
operator: "LessThan",
value: endDate.toJSON(),
},
);
}