Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Fix 'last month' link option
Uku Taht3e33385afd5d
diff --git a/assets/js/dashboard/date.js b/assets/js/dashboard/date.jsindex 0470381c35..477307686b 100644--- a/assets/js/dashboard/date.js+++ b/assets/js/dashboard/date.js@@ -7,8 +7,12 @@ export function formatISO(date) {export function shiftMonths(date, months) {const newDate = new Date(date.getTime())- newDate.setMonth(newDate.getMonth() + months)- return newDate+ const d = newDate.getDate();+ newDate.setMonth(newDate.getMonth() + +months);+ if (newDate.getDate() != d) {+ newDate.setDate(0);+ }+ return newDate;}export function shiftDays(date, days) {diff --git a/assets/js/dashboard/datepicker.js b/assets/js/dashboard/datepicker.jsindex 8ba6bdf4f0..2184ca8b71 100644--- a/assets/js/dashboard/datepicker.js+++ b/assets/js/dashboard/datepicker.js@@ -294,7 +294,7 @@ class DatePicker extends React.Component {boldClass = query.period === period ? "font-bold" : "";}- const date = opts.date ? formatISO(opts.date) : false;+ opts.date = opts.date ? formatISO(opts.date) : false;const keybinds = {'Today': 'D',@@ -308,7 +308,7 @@ class DatePicker extends React.Component {return (<QueryLink- to={{from: false, to: false, date, period, ...opts}}+ to={{from: false, to: false, period, ...opts}}onClick={this.close.bind(this)}query={this.props.query}className={`${boldClass } px-4 py-2 md:text-sm leading-tight hover:bg-gray-100diff --git a/assets/js/dashboard/query.js b/assets/js/dashboard/query.jsindex f9dc47d33b..6f10f78d5f 100644--- a/assets/js/dashboard/query.js+++ b/assets/js/dashboard/query.js@@ -79,8 +79,8 @@ export function navigateToQuery(history, queryFrom, newData) {}class QueryLink extends React.Component {- constructor() {- super()+ constructor(props) {+ super(props)this.onClick = this.onClick.bind(this)}