diff --git a/packages/sanity/src/core/studio/studioAnnouncements/query.ts b/packages/sanity/src/core/studio/studioAnnouncements/query.ts index 48c6131f5cec..786fc84b281c 100644 --- a/packages/sanity/src/core/studio/studioAnnouncements/query.ts +++ b/packages/sanity/src/core/studio/studioAnnouncements/query.ts @@ -1,7 +1,12 @@ /** * TODO: Remove once the API call is implemented */ -export const studioAnnouncementQuery = `*[_type == "productAnnouncement"] | order(publishedDate desc) { +export const studioAnnouncementQuery = `*[_type == "productAnnouncement" && + ( + !defined(expiryDate) || + defined(expiryDate) && dateTime(expiryDate) > dateTime(now()) + )] + | order(publishedDate desc) { ..., body[]{ ...,