Reputation: 2210
I need a filter condition where....
StartDate <= effectiveFrom OR StartDate <= effectiveFrom + 7 days.
How do I add an OR statment to the below code?
filters: [
new Filter("ShopId", FilterOperator.EQ, that.sitId),
new Filter("CategoryId", FilterOperator.EQ, "S"),
new Filter("ApprovalId", FilterOperator.EQ, "3"),
new Filter("StartDate", FilterOperator.LE, moment(new Date(effectiveFrom)).toDate()),
Upvotes: 0
Views: 404
Reputation: 1742
var f1 = new Filter("StartDate", FilterOperator.LE, moment(new Date(effectiveFrom)).toDate());
var f2 = new Filter("StartDate", FilterOperator.LE, moment(new Date(effectiveFrom)).add(7,'days').toDate());
var filter = new sap.ui.model.Filter({
filters: [f1,f2],
and: false
})
Upvotes: 1