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