fix(reports): use local date boundaries for landing page stats filters

This commit is contained in:
Rodrigo Borba 2026-03-02 21:41:35 -03:00
parent a0fcf37e33
commit 6d61b9b286

View File

@ -33,6 +33,13 @@ const tabs = [
const lpStats = ref(null);
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) {
const end = new Date();
const start = new Date();
@ -83,8 +90,8 @@ function getPeriodDates(period) {
}
return {
period_start: start.toISOString().split('T')[0],
period_end: end.toISOString().split('T')[0],
period_start: formatLocalDate(start),
period_end: formatLocalDate(end),
};
}