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) => {
|
{rows.map(({ date, visitors, records }, rowIndex) => {
|
||||||
return (
|
return (
|
||||||
<div key={rowIndex} className={styles.row}>
|
<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>
|
<div className={styles.visitors}>{visitors}</div>
|
||||||
{days.map(day => {
|
{days.map(day => {
|
||||||
if (totalDays - rowIndex < day) {
|
if (totalDays - rowIndex < day) {
|
||||||
|
@ -9,7 +9,8 @@ import * as yup from 'yup';
|
|||||||
|
|
||||||
export interface RetentionRequestBody {
|
export interface RetentionRequestBody {
|
||||||
websiteId: string;
|
websiteId: string;
|
||||||
dateRange: { startDate: string; endDate: string; timezone: string };
|
dateRange: { startDate: string; endDate: string };
|
||||||
|
timezone: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const schema = {
|
const schema = {
|
||||||
@ -20,9 +21,9 @@ const schema = {
|
|||||||
.shape({
|
.shape({
|
||||||
startDate: yup.date().required(),
|
startDate: yup.date().required(),
|
||||||
endDate: yup.date().required(),
|
endDate: yup.date().required(),
|
||||||
timezone: TimezoneTest,
|
|
||||||
})
|
})
|
||||||
.required(),
|
.required(),
|
||||||
|
timezone: TimezoneTest,
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -37,7 +38,8 @@ export default async (
|
|||||||
if (req.method === 'POST') {
|
if (req.method === 'POST') {
|
||||||
const {
|
const {
|
||||||
websiteId,
|
websiteId,
|
||||||
dateRange: { startDate, endDate, timezone },
|
dateRange: { startDate, endDate },
|
||||||
|
timezone,
|
||||||
} = req.body;
|
} = req.body;
|
||||||
|
|
||||||
if (!(await canViewWebsite(req.auth, websiteId))) {
|
if (!(await canViewWebsite(req.auth, websiteId))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user