File tree 2 files changed +19
-3
lines changed
frontend/express/public/javascripts/countly
plugins/server-stats/frontend/public/javascripts
2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 169
169
170
170
store . set ( "countly_date" , period ) ;
171
171
} ;
172
+ /* Returns strings representing dates, not timestamps*/
173
+ countlyCommon . getPeriodAsDateStrings = function ( ) {
174
+ var array = [ ] ;
175
+ if ( Array . isArray ( _period ) ) {
176
+ if ( countlyCommon . periodObj . currentPeriodArr && countlyCommon . periodObj . currentPeriodArr . length > 0 ) {
177
+ var splitted = countlyCommon . periodObj . currentPeriodArr [ 0 ] . split ( "." ) ;
178
+ array . push ( splitted [ 2 ] + "-" + splitted [ 1 ] + "-" + splitted [ 0 ] + " 00:00:00" ) ;
179
+ splitted = countlyCommon . periodObj . currentPeriodArr [ countlyCommon . periodObj . currentPeriodArr . length - 1 ] . split ( "." ) ;
180
+ array . push ( splitted [ 2 ] + "-" + splitted [ 1 ] + "-" + splitted [ 0 ] + " 23:59:59" ) ;
181
+ }
182
+ return JSON . stringify ( array ) ;
183
+ }
184
+ else {
185
+ return countlyCommon . getPeriodForAjax ( ) ;
186
+ }
187
+ } ;
172
188
173
189
/**
174
190
* Get currently selected period
Original file line number Diff line number Diff line change 15
15
type : "GET" ,
16
16
url : countlyCommon . API_PARTS . data . r + "/server-stats/data-points" ,
17
17
data : {
18
- "period" : countlyCommon . getPeriodForAjax ( ) ,
18
+ "period" : countlyCommon . getPeriodAsDateStrings ( ) ,
19
19
"selected_app" : options . app_id || "" ,
20
20
} ,
21
21
dataType : "json" ,
31
31
32
32
countlyDataPoints . punchCard = function ( options ) {
33
33
var data = { } ;
34
- data . period = countlyCommon . getPeriodForAjax ( ) ;
34
+ data . period = countlyCommon . getPeriodAsDateStrings ( ) ;
35
35
36
36
if ( options . app_id ) {
37
37
data . selected_app = options . app_id ;
53
53
54
54
countlyDataPoints . calculateTop = function ( /*options*/ ) {
55
55
var data = { } ;
56
- data . period = countlyCommon . getPeriodForAjax ( ) ;
56
+ data . period = countlyCommon . getPeriodAsDateStrings ( ) ;
57
57
return $ . when (
58
58
$ . ajax ( {
59
59
type : "GET" ,
You can’t perform that action at this time.
0 commit comments