Skip to content

Commit f3ed352

Browse files
authored
Merge pull request #5261 from Countly/drill-params-fix
[drill][fix] allow "prevMonth" as period param
2 parents b1ad706 + 90fd60a commit f3ed352

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

api/lib/countly.common.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -786,10 +786,16 @@ countlyCommon.isValidPeriodParam = function(period) {
786786
}
787787

788788
if (typeof period === 'object') {
789-
return Object.prototype.hasOwnProperty.call(period, 'since') || Object.prototype.hasOwnProperty.call(period, 'period');
789+
if (Object.prototype.hasOwnProperty.call(period, 'period')) {
790+
return countlyCommon.isValidPeriodParam(period.period);
791+
}
792+
else {
793+
return Object.prototype.hasOwnProperty.call(period, 'since');
794+
}
790795
}
791796

792797
return period === 'month' ||
798+
period === 'prevMonth' ||
793799
period === 'day' ||
794800
period === 'yesterday' ||
795801
period === 'hour' ||

0 commit comments

Comments
 (0)