|
|
|
@ -7,14 +7,17 @@ export const getCurrentAnnouncements = async (
|
|
|
|
|
const payload = await getPayload();
|
|
|
|
|
|
|
|
|
|
const today = new Date();
|
|
|
|
|
const todayDay = new Date(today.getFullYear(), today.getMonth(), today.getDay());
|
|
|
|
|
|
|
|
|
|
return await payload.find({
|
|
|
|
|
collection: "announcement",
|
|
|
|
|
sort: "from",
|
|
|
|
|
where: {
|
|
|
|
|
or: [
|
|
|
|
|
{ from: { equals: today } },
|
|
|
|
|
{ and: [{ from: { less_than_equal: today } }, { to: { greater_than_equal: today } }] },
|
|
|
|
|
{ from: { equals: todayDay } },
|
|
|
|
|
{
|
|
|
|
|
and: [{ from: { less_than_equal: todayDay } }, { to: { greater_than_equal: todayDay } }],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
pagination: false,
|
|
|
|
|