Skip to content

Commit

Permalink
Fix timezone issue for timeline chart, now it matches the server time…
Browse files Browse the repository at this point in the history
…. 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
  • Loading branch information
mrincon committed Nov 13, 2015
1 parent 4999ab2 commit 8fb3832
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 49 deletions.
3 changes: 1 addition & 2 deletions app/src/prReporting/prDashboardWidgets/timeline/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ angular.module('pr.dashboard.widgets.timeline', [
xAxis: {
axisLabel: 'Time',
tickFormat: function(d) {
console.lo
return prUIOptionService.getxAxisTickFormat(d, $scope.params.granularity, prApi.timezone);
return prUIOptionService.getxAxisTickFormat(d, $scope.params.granularity);
}
},
showLegend: true
Expand Down
9 changes: 4 additions & 5 deletions app/src/prReporting/prUIOption/prUIOptionService.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,15 @@ angular.module('pr.UIOption')
* @description Formats a date according to a granularity, shows a more detailed time if the granularity is higher.
* @param {date} date Date to format
* @param {string=} granularity (hour or minute)
* @param {string=} timezone Timezone (MST)
* @return {object} A date formatted by moment.js
*/
getxAxisTickFormat: function(date, granularity, timezone) {
getxAxisTickFormat: function(date, granularity) {
if (granularity === 'hour') {
return moment(date).tz(timezone).format('MMM DD, HH:mm');
return moment(date).format('MMM DD, HH:mm');
} else if (granularity === 'minute') {
return moment(date).tz(timezone).format('MMM DD, HH:mm');
return moment(date).format('MMM DD, HH:mm');
} else {
return moment(date).tz(timezone).format('MMM DD');
return moment(date).format('MMM DD');
}
},

Expand Down
8 changes: 4 additions & 4 deletions app/test/prReporting/prUIOption/prUIOptionService.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ describe('pr.UIOption.prUIOptionService', function() {
});

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

it('getIndexCellTemplate', function() {
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"moment": "~2.10.6",
"moment-timezone": "0.4.0",
"countto": "~1.1.0",
"angular-bootstrap": "0.13.0",
"angular-bootstrap": "~0.14.3",
"angular-moment": "0.10.0",
"knex": "0.7.6",
"jquery-ui": "~1.11.4",
Expand Down
2 changes: 1 addition & 1 deletion dist/app/app.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions dist/app/css/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
left: 0;
z-index: 10001;
height: 2px;
background-color: #ccd1d9;
background-color: #CCD1D9;
}
#loading-bar .bar {
background: #656d78;
background: #656D78;
}
/* Fancy blur effect */
#loading-bar .peg {
-moz-box-shadow: #656d78 1px 0 6px 1px;
-ms-box-shadow: #656d78 1px 0 6px 1px;
-webkit-box-shadow: #656d78 1px 0 6px 1px;
box-shadow: #656d78 1px 0 6px 1px;
-moz-box-shadow: #656D78 1px 0 6px 1px;
-ms-box-shadow: #656D78 1px 0 6px 1px;
-webkit-box-shadow: #656D78 1px 0 6px 1px;
box-shadow: #656D78 1px 0 6px 1px;
}
#loading-bar-spinner {
top: auto;
left: 15px;
bottom: 15px;
}
#loading-bar-spinner .spinner-icon {
border-top-color: #656d78;
border-left-color: #656d78;
border-top-color: #656D78;
border-left-color: #656D78;
}
2 changes: 1 addition & 1 deletion dist/app/css/demo.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/app/demo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions dist/pulsar-reporting-ui-tpls.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
pulsar-reporting-ui | 0.2.0
pulsar-reporting-ui | 0.2.1
Copyright (C) 2012-2015 eBay Software Foundation
Licenses: MIT & Apache 2.0
*/
Expand Down Expand Up @@ -1263,16 +1263,15 @@ angular.module('pr.UIOption')
* @description Formats a date according to a granularity, shows a more detailed time if the granularity is higher.
* @param {date} date Date to format
* @param {string=} granularity (hour or minute)
* @param {string=} timezone Timezone (MST)
* @return {object} A date formatted by moment.js
*/
getxAxisTickFormat: function(date, granularity, timezone) {
getxAxisTickFormat: function(date, granularity) {
if (granularity === 'hour') {
return moment(date).tz(timezone).format('MMM DD, HH:mm');
return moment(date).format('MMM DD, HH:mm');
} else if (granularity === 'minute') {
return moment(date).tz(timezone).format('MMM DD, HH:mm');
return moment(date).format('MMM DD, HH:mm');
} else {
return moment(date).tz(timezone).format('MMM DD');
return moment(date).format('MMM DD');
}
},

Expand Down Expand Up @@ -3189,8 +3188,7 @@ angular.module('pr.dashboard.widgets.timeline', [
xAxis: {
axisLabel: 'Time',
tickFormat: function(d) {
console.lo
return prUIOptionService.getxAxisTickFormat(d, $scope.params.granularity, prApi.timezone);
return prUIOptionService.getxAxisTickFormat(d, $scope.params.granularity);
}
},
showLegend: true
Expand Down
8 changes: 4 additions & 4 deletions dist/pulsar-reporting-ui-tpls.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pulsar-reporting-ui-tpls.min.js.map

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions dist/pulsar-reporting-ui.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
pulsar-reporting-ui | 0.2.0
pulsar-reporting-ui | 0.2.1
Copyright (C) 2012-2015 eBay Software Foundation
Licenses: MIT & Apache 2.0
*/
Expand Down Expand Up @@ -951,16 +951,15 @@ angular.module('pr.UIOption')
* @description Formats a date according to a granularity, shows a more detailed time if the granularity is higher.
* @param {date} date Date to format
* @param {string=} granularity (hour or minute)
* @param {string=} timezone Timezone (MST)
* @return {object} A date formatted by moment.js
*/
getxAxisTickFormat: function(date, granularity, timezone) {
getxAxisTickFormat: function(date, granularity) {
if (granularity === 'hour') {
return moment(date).tz(timezone).format('MMM DD, HH:mm');
return moment(date).format('MMM DD, HH:mm');
} else if (granularity === 'minute') {
return moment(date).tz(timezone).format('MMM DD, HH:mm');
return moment(date).format('MMM DD, HH:mm');
} else {
return moment(date).tz(timezone).format('MMM DD');
return moment(date).format('MMM DD');
}
},

Expand Down Expand Up @@ -2877,8 +2876,7 @@ angular.module('pr.dashboard.widgets.timeline', [
xAxis: {
axisLabel: 'Time',
tickFormat: function(d) {
console.lo
return prUIOptionService.getxAxisTickFormat(d, $scope.params.granularity, prApi.timezone);
return prUIOptionService.getxAxisTickFormat(d, $scope.params.granularity);
}
},
showLegend: true
Expand Down
6 changes: 3 additions & 3 deletions dist/pulsar-reporting-ui.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pulsar-reporting-ui.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pulsar-reporting-ui",
"version": "0.2.0",
"version": "0.2.1",
"repository": {
"type": "git",
"url": "https://github.com/pulsarIO/pulsar-reporting-ui.git"
Expand Down

0 comments on commit 8fb3832

Please sign in to comment.