Skip to content

Commit 697cb62

Browse files
committed
[core] update setPeriod func
1 parent fbe0763 commit 697cb62

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

frontend/express/public/javascripts/countly/countly.common.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,15 @@
9595
/**
9696
* Change currently selected period
9797
* @param {string|array} period - new period, supported values are (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])
98+
* @param {int} timeStamp - timeStamp for the period based
9899
*/
99-
countlyCommon.setPeriod = function (period) {
100+
countlyCommon.setPeriod = function (period, timeStamp) {
100101
_period = period;
101-
countlyCommon.periodObj = calculatePeriodObj();
102+
if(timeStamp){
103+
countlyCommon.periodObj = countlyCommon.calcSpecificPeriodObj(period, timeStamp)
104+
}else{
105+
countlyCommon.periodObj = calculatePeriodObj(period);
106+
}
102107
store.set("countly_date", period);
103108
};
104109

0 commit comments

Comments
 (0)