From 329863190e28227f40eec2527cc06d0ddbe56349 Mon Sep 17 00:00:00 2001 From: matthew Date: Sun, 9 Oct 2022 23:15:18 +0400 Subject: [PATCH] fix date --- searching-front/app/core/pages/State/State.tsx | 3 ++- .../app/stateSites/queries/getLastWeekNewSites.ts | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/searching-front/app/core/pages/State/State.tsx b/searching-front/app/core/pages/State/State.tsx index 47be1a9..04dd76c 100644 --- a/searching-front/app/core/pages/State/State.tsx +++ b/searching-front/app/core/pages/State/State.tsx @@ -89,6 +89,7 @@ const State = ({ historyOfState: historyOfStatePreloaded, lastWeekNewSites, }: StatePageProps) => { + const nowDate = format(new Date(),'d MMMM').toLowerCase(); const [historyPeriod, setHistoryPeriod] = useState(InfluxPeriod.D) const { t } = useTranslation() const [historyOfState] = useQuery(getHistoryOfSitesState, historyPeriod, { @@ -105,7 +106,7 @@ const State = ({ / {actualState.allDomainsCount}
{t("state.areNowAvailable")}
-
9 september
+
{nowDate}
diff --git a/searching-front/app/stateSites/queries/getLastWeekNewSites.ts b/searching-front/app/stateSites/queries/getLastWeekNewSites.ts index 2695b2f..eb85a67 100644 --- a/searching-front/app/stateSites/queries/getLastWeekNewSites.ts +++ b/searching-front/app/stateSites/queries/getLastWeekNewSites.ts @@ -2,14 +2,12 @@ import { subDays } from "date-fns" import db from "db" export default async function getLastWeekNewSites() { - const weekAgo = subDays(new Date(), 7) - const lastWeekNewSites = await db.nftDomain.findMany({ orderBy: { firstAvailableDate: "desc" }, take: 10, - where: { available: true, AND: { firstAvailableDate: { gt: weekAgo } } }, + where: { available: true }, }) - console.log(lastWeekNewSites) + return { lastWeekNewSites, }