Fix calendar layout filter (#8840)

This commit is contained in:
Rijk van Zanten
2021-10-15 17:33:11 -04:00
committed by GitHub
parent 9f163ce320
commit a18fd90731

View File

@@ -58,9 +58,8 @@ export default defineLayout<LayoutOptions>({
const filterWithCalendarView = computed(() => {
if (!calendar.value || !startDateField.value) return filter.value;
return {
const calendarFilter: Filter = {
_and: [
filter.value,
{
[startDateField.value]: {
_gte: formatISO(calendar.value.view.currentStart),
@@ -72,7 +71,13 @@ export default defineLayout<LayoutOptions>({
},
},
],
} as Filter;
};
if (filter.value) {
calendarFilter._and.push(filter.value);
}
return calendarFilter;
});
const template = computed({