fix(reports): use local date boundaries for landing page stats filters
This commit is contained in:
parent
a0fcf37e33
commit
6d61b9b286
@ -33,6 +33,13 @@ const tabs = [
|
|||||||
const lpStats = ref(null);
|
const lpStats = ref(null);
|
||||||
const lpLoading = ref(false);
|
const lpLoading = ref(false);
|
||||||
|
|
||||||
|
function formatLocalDate(date) {
|
||||||
|
const y = date.getFullYear();
|
||||||
|
const m = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const d = String(date.getDate()).padStart(2, '0');
|
||||||
|
return `${y}-${m}-${d}`;
|
||||||
|
}
|
||||||
|
|
||||||
function getPeriodDates(period) {
|
function getPeriodDates(period) {
|
||||||
const end = new Date();
|
const end = new Date();
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
@ -83,8 +90,8 @@ function getPeriodDates(period) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
period_start: start.toISOString().split('T')[0],
|
period_start: formatLocalDate(start),
|
||||||
period_end: end.toISOString().split('T')[0],
|
period_end: formatLocalDate(end),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user