Fixes to due predicates

This commit is contained in:
John Supplee 2021-02-26 14:11:24 +02:00
parent 5fe58dc9ae
commit 8e911a42f5

View file

@ -368,7 +368,7 @@ BlazeComponent.extendComponent({
} else if (operator === 'dueAt' && value === 'overdue') {
value = {
operator: '$lt',
value: moment().format(),
value: moment(moment().format('YYYY-MM-DD')).format(),
};
} else {
this.parsingErrors.push({
@ -380,15 +380,15 @@ BlazeComponent.extendComponent({
} else {
if (operator === 'dueAt') {
value = {
operator: '$lte',
value: moment()
.add(days, duration ? duration : 'days')
operator: '$lt',
value: moment(moment().format('YYYY-MM-DD'))
.add(days + 1, duration ? duration : 'days')
.format(),
};
} else {
value = {
operator: '$gte',
value: moment()
value: moment(moment().format('YYYY-MM-DD'))
.subtract(days, duration ? duration : 'days')
.format(),
};