Allowing custom date range to be supplied in pageviews graph, closes #5541

This commit is contained in:
Julian Lam
2017-05-11 11:41:28 -04:00
parent 544faa7861
commit 064a8aa6d7
7 changed files with 115 additions and 26 deletions

View File

@@ -211,10 +211,12 @@ SocketAdmin.analytics.get = function (socket, data, callback) {
}
// Default returns views from past 24 hours, by hour
if (data.units === 'days') {
data.amount = 30;
} else {
data.amount = 24;
if (!data.amount) {
if (data.units === 'days') {
data.amount = 30;
} else {
data.amount = 24;
}
}
if (data.graph === 'traffic') {