Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenaka <diosmosis@users.noreply.github.com>2017-12-04 03:11:45 +0300
committerMatthieu Aubry <mattab@users.noreply.github.com>2017-12-04 03:11:45 +0300
commitf85ec8f81d291da0f0785a95c70064f6723041c4 (patch)
tree291eaaf329ae61c112c6b9578303d3d4d57899d6
parent2ba9409967d8716484c12aa23ad81c6097e62695 (diff)
Do not allow piwik global frontend date properties to have value of previous7/last7, since the frontend does not expect those values. (#12324)
-rw-r--r--plugins/CoreHome/angularjs/common/services/piwik.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/CoreHome/angularjs/common/services/piwik.js b/plugins/CoreHome/angularjs/common/services/piwik.js
index 53cace77bf..d9eaaf5d8c 100644
--- a/plugins/CoreHome/angularjs/common/services/piwik.js
+++ b/plugins/CoreHome/angularjs/common/services/piwik.js
@@ -31,6 +31,16 @@
piwik.period = period;
+ var dateRange = piwikPeriods.parse(period, date).getDateRange();
+ piwik.startDateString = $.datepicker.formatDate('yy-mm-dd', dateRange[0]);
+ piwik.endDateString = $.datepicker.formatDate('yy-mm-dd', dateRange[1]);
+
+ // do not set anything to previous7/last7, as piwik frontend code does not
+ // expect those values.
+ if (piwik.period === 'range') {
+ date = piwik.startDateString + ',' + piwik.endDateString;
+ }
+
if (date && date.indexOf(',') > -1) {
var dateParts = date.split(',');
if (dateParts[1]) {
@@ -41,10 +51,6 @@
} else {
piwik.currentDateString = date;
}
-
- var dateRange = piwikPeriods.parse(period, date).getDateRange();
- piwik.startDateString = $.datepicker.formatDate('yy-mm-dd', dateRange[0]);
- piwik.endDateString = $.datepicker.formatDate('yy-mm-dd', dateRange[1]);
}
function isValidPeriod(periodStr, dateStr) {