Skip to content

Commit 8fb3832

Browse files
author
mrincon
committed
Fix timezone issue for timeline chart, now it matches the server time. Updated the corresponding getxAxisTickFormat test
Fixed version of angular boostrap to use ~0.14.3 due to modal close/dismiss issues Bumped version to 0.2.1
1 parent 4999ab2 commit 8fb3832

15 files changed

+43
-49
lines changed

app/src/prReporting/prDashboardWidgets/timeline/timeline.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ angular.module('pr.dashboard.widgets.timeline', [
119119
xAxis: {
120120
axisLabel: 'Time',
121121
tickFormat: function(d) {
122-
console.lo
123-
return prUIOptionService.getxAxisTickFormat(d, $scope.params.granularity, prApi.timezone);
122+
return prUIOptionService.getxAxisTickFormat(d, $scope.params.granularity);
124123
}
125124
},
126125
showLegend: true

app/src/prReporting/prUIOption/prUIOptionService.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,15 @@ angular.module('pr.UIOption')
174174
* @description Formats a date according to a granularity, shows a more detailed time if the granularity is higher.
175175
* @param {date} date Date to format
176176
* @param {string=} granularity (hour or minute)
177-
* @param {string=} timezone Timezone (MST)
178177
* @return {object} A date formatted by moment.js
179178
*/
180-
getxAxisTickFormat: function(date, granularity, timezone) {
179+
getxAxisTickFormat: function(date, granularity) {
181180
if (granularity === 'hour') {
182-
return moment(date).tz(timezone).format('MMM DD, HH:mm');
181+
return moment(date).format('MMM DD, HH:mm');
183182
} else if (granularity === 'minute') {
184-
return moment(date).tz(timezone).format('MMM DD, HH:mm');
183+
return moment(date).format('MMM DD, HH:mm');
185184
} else {
186-
return moment(date).tz(timezone).format('MMM DD');
185+
return moment(date).format('MMM DD');
187186
}
188187
},
189188

app/test/prReporting/prUIOption/prUIOptionService.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ describe('pr.UIOption.prUIOptionService', function() {
9595
});
9696

9797
it('getxAxisTickFormat', function() {
98-
var d = new Date(Date.UTC(115, 7, 10, 17, 05, 0));
99-
expect(service.getxAxisTickFormat(d, 'hour', 'UTC')).toEqual('Aug 10, 17:05');
100-
expect(service.getxAxisTickFormat(d, 'minute', 'UTC')).toEqual('Aug 10, 17:05');
101-
expect(service.getxAxisTickFormat(d, 'day', 'UTC')).toEqual('Aug 10');
98+
var d = moment('2015-08-10 17:05:00', 'YYYY-MM-DD HH:mm:ss');
99+
expect(service.getxAxisTickFormat(d, 'hour')).toEqual('Aug 10, 17:05');
100+
expect(service.getxAxisTickFormat(d, 'minute')).toEqual('Aug 10, 17:05');
101+
expect(service.getxAxisTickFormat(d, 'day')).toEqual('Aug 10');
102102
});
103103

104104
it('getIndexCellTemplate', function() {

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"moment": "~2.10.6",
2828
"moment-timezone": "0.4.0",
2929
"countto": "~1.1.0",
30-
"angular-bootstrap": "0.13.0",
30+
"angular-bootstrap": "~0.14.3",
3131
"angular-moment": "0.10.0",
3232
"knex": "0.7.6",
3333
"jquery-ui": "~1.11.4",

dist/app/app.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/app/css/demo.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
left: 0;
66
z-index: 10001;
77
height: 2px;
8-
background-color: #ccd1d9;
8+
background-color: #CCD1D9;
99
}
1010
#loading-bar .bar {
11-
background: #656d78;
11+
background: #656D78;
1212
}
1313
/* Fancy blur effect */
1414
#loading-bar .peg {
15-
-moz-box-shadow: #656d78 1px 0 6px 1px;
16-
-ms-box-shadow: #656d78 1px 0 6px 1px;
17-
-webkit-box-shadow: #656d78 1px 0 6px 1px;
18-
box-shadow: #656d78 1px 0 6px 1px;
15+
-moz-box-shadow: #656D78 1px 0 6px 1px;
16+
-ms-box-shadow: #656D78 1px 0 6px 1px;
17+
-webkit-box-shadow: #656D78 1px 0 6px 1px;
18+
box-shadow: #656D78 1px 0 6px 1px;
1919
}
2020
#loading-bar-spinner {
2121
top: auto;
2222
left: 15px;
2323
bottom: 15px;
2424
}
2525
#loading-bar-spinner .spinner-icon {
26-
border-top-color: #656d78;
27-
border-left-color: #656d78;
26+
border-top-color: #656D78;
27+
border-left-color: #656D78;
2828
}

dist/app/css/demo.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/app/demo.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pulsar-reporting-ui-tpls.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
pulsar-reporting-ui | 0.2.0
2+
pulsar-reporting-ui | 0.2.1
33
Copyright (C) 2012-2015 eBay Software Foundation
44
Licenses: MIT & Apache 2.0
55
*/
@@ -1263,16 +1263,15 @@ angular.module('pr.UIOption')
12631263
* @description Formats a date according to a granularity, shows a more detailed time if the granularity is higher.
12641264
* @param {date} date Date to format
12651265
* @param {string=} granularity (hour or minute)
1266-
* @param {string=} timezone Timezone (MST)
12671266
* @return {object} A date formatted by moment.js
12681267
*/
1269-
getxAxisTickFormat: function(date, granularity, timezone) {
1268+
getxAxisTickFormat: function(date, granularity) {
12701269
if (granularity === 'hour') {
1271-
return moment(date).tz(timezone).format('MMM DD, HH:mm');
1270+
return moment(date).format('MMM DD, HH:mm');
12721271
} else if (granularity === 'minute') {
1273-
return moment(date).tz(timezone).format('MMM DD, HH:mm');
1272+
return moment(date).format('MMM DD, HH:mm');
12741273
} else {
1275-
return moment(date).tz(timezone).format('MMM DD');
1274+
return moment(date).format('MMM DD');
12761275
}
12771276
},
12781277

@@ -3189,8 +3188,7 @@ angular.module('pr.dashboard.widgets.timeline', [
31893188
xAxis: {
31903189
axisLabel: 'Time',
31913190
tickFormat: function(d) {
3192-
console.lo
3193-
return prUIOptionService.getxAxisTickFormat(d, $scope.params.granularity, prApi.timezone);
3191+
return prUIOptionService.getxAxisTickFormat(d, $scope.params.granularity);
31943192
}
31953193
},
31963194
showLegend: true

dist/pulsar-reporting-ui-tpls.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)