diff --git a/src/app/(main)/reports/retention/RetentionTable.tsx b/src/app/(main)/reports/retention/RetentionTable.tsx
index 171c5bd3..1770a764 100644
--- a/src/app/(main)/reports/retention/RetentionTable.tsx
+++ b/src/app/(main)/reports/retention/RetentionTable.tsx
@@ -52,7 +52,7 @@ export function RetentionTable({ days = DAYS }) {
{rows.map(({ date, visitors, records }, rowIndex) => {
return (
-
{formatDate(`${date} 00:00:00`, 'PP', locale)}
+
{formatDate(date, 'PP', locale)}
{visitors}
{days.map(day => {
if (totalDays - rowIndex < day) {
diff --git a/src/pages/api/reports/retention.ts b/src/pages/api/reports/retention.ts
index 6ff7bbe1..f4d9b7df 100644
--- a/src/pages/api/reports/retention.ts
+++ b/src/pages/api/reports/retention.ts
@@ -9,7 +9,8 @@ import * as yup from 'yup';
export interface RetentionRequestBody {
websiteId: string;
- dateRange: { startDate: string; endDate: string; timezone: string };
+ dateRange: { startDate: string; endDate: string };
+ timezone: string;
}
const schema = {
@@ -20,9 +21,9 @@ const schema = {
.shape({
startDate: yup.date().required(),
endDate: yup.date().required(),
- timezone: TimezoneTest,
})
.required(),
+ timezone: TimezoneTest,
}),
};
@@ -37,7 +38,8 @@ export default async (
if (req.method === 'POST') {
const {
websiteId,
- dateRange: { startDate, endDate, timezone },
+ dateRange: { startDate, endDate },
+ timezone,
} = req.body;
if (!(await canViewWebsite(req.auth, websiteId))) {