mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-06 01:15:42 +01:00
fix retention report invalid date
This commit is contained in:
parent
2c18cca3cd
commit
7582670aef
@ -52,7 +52,7 @@ export function RetentionTable({ days = DAYS }) {
|
||||
{rows.map(({ date, visitors, records }, rowIndex) => {
|
||||
return (
|
||||
<div key={rowIndex} className={styles.row}>
|
||||
<div className={styles.date}>{formatDate(`${date} 00:00:00`, 'PP', locale)}</div>
|
||||
<div className={styles.date}>{formatDate(date, 'PP', locale)}</div>
|
||||
<div className={styles.visitors}>{visitors}</div>
|
||||
{days.map(day => {
|
||||
if (totalDays - rowIndex < day) {
|
||||
|
@ -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))) {
|
||||
|
Loading…
Reference in New Issue
Block a user