Skip to content

Commit

Permalink
#154 changed gap filling logic by interval
Browse files Browse the repository at this point in the history
  • Loading branch information
itayw committed Dec 2, 2014
1 parent f5a4c93 commit a34a887
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 59 deletions.
38 changes: 19 additions & 19 deletions build/release/joola.js
Original file line number Diff line number Diff line change
Expand Up @@ -25599,20 +25599,24 @@ proto.makeChartTimelineSeries = function (message) {
try {
var _date = new Date(date);
var _basedate = new Date(document.values[timestampDimension.key]);
//switch (interval) {
//case 'month':
//case 'day':
// _date.setHours(_date.getHours() - (_date.getTimezoneOffset() / 60));
// return _basedate.getTime() === _date.getTime();
//case 'minute':
// _basedate.setSeconds(0);
// _basedate.setMilliseconds(0);
// return _basedate.getTime() === _date.getTime();
//default:
// _basedate.setMilliseconds(0);
console.log(_basedate.toISOString(), _date.toISOString());
return _basedate.getTime() === _date.getTime();
// }
switch (interval) {
case 'month':
case 'day':
_date.setHours(_date.getHours() - (_date.getTimezoneOffset() / 60));
console.log(_basedate.getTime(), _date.getTime());
return _basedate.getTime() === _date.getTime();
case 'minute':
_basedate.setSeconds(0);
_basedate.setMilliseconds(0);
console.log(_basedate.getTime(), _date.getTime());
return _basedate.getTime() === _date.getTime();
case 'second':
_basedate.setMilliseconds(0);
console.log(_basedate.getTime(), _date.getTime());
return _basedate.getTime() === _date.getTime();
default:
return _basedate.getTime() === _date.getTime();
}
}
catch (ex) {
console.log('exception while checkExists', ex);
Expand Down Expand Up @@ -25684,11 +25688,7 @@ proto.makeChartTimelineSeries = function (message) {
break;
}

//if (['day', 'month', 'year'].indexOf(interval) > -1)
exists = checkExists(timestampDimension, result.documents, _d, true);
//else
// exists = checkExists(timestampDimension, result.documents, _d);

exists = checkExists(timestampDimension, result.documents, _d);
if (!exists) {
exists = {values: {}, fvalues: {}};
exists.values[timestampDimension.key] = _d.toISOString();
Expand Down
2 changes: 1 addition & 1 deletion build/release/joola.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/release/joola.min.js.map

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions build/temp/joola.js
Original file line number Diff line number Diff line change
Expand Up @@ -25599,20 +25599,24 @@ proto.makeChartTimelineSeries = function (message) {
try {
var _date = new Date(date);
var _basedate = new Date(document.values[timestampDimension.key]);
//switch (interval) {
//case 'month':
//case 'day':
// _date.setHours(_date.getHours() - (_date.getTimezoneOffset() / 60));
// return _basedate.getTime() === _date.getTime();
//case 'minute':
// _basedate.setSeconds(0);
// _basedate.setMilliseconds(0);
// return _basedate.getTime() === _date.getTime();
//default:
// _basedate.setMilliseconds(0);
console.log(_basedate.toISOString(), _date.toISOString());
return _basedate.getTime() === _date.getTime();
// }
switch (interval) {
case 'month':
case 'day':
_date.setHours(_date.getHours() - (_date.getTimezoneOffset() / 60));
console.log(_basedate.getTime(), _date.getTime());
return _basedate.getTime() === _date.getTime();
case 'minute':
_basedate.setSeconds(0);
_basedate.setMilliseconds(0);
console.log(_basedate.getTime(), _date.getTime());
return _basedate.getTime() === _date.getTime();
case 'second':
_basedate.setMilliseconds(0);
console.log(_basedate.getTime(), _date.getTime());
return _basedate.getTime() === _date.getTime();
default:
return _basedate.getTime() === _date.getTime();
}
}
catch (ex) {
console.log('exception while checkExists', ex);
Expand Down Expand Up @@ -25684,11 +25688,7 @@ proto.makeChartTimelineSeries = function (message) {
break;
}

//if (['day', 'month', 'year'].indexOf(interval) > -1)
exists = checkExists(timestampDimension, result.documents, _d, true);
//else
// exists = checkExists(timestampDimension, result.documents, _d);

exists = checkExists(timestampDimension, result.documents, _d);
if (!exists) {
exists = {values: {}, fvalues: {}};
exists.values[timestampDimension.key] = _d.toISOString();
Expand Down
38 changes: 19 additions & 19 deletions src/lib/viz/_proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,24 @@ proto.makeChartTimelineSeries = function (message) {
try {
var _date = new Date(date);
var _basedate = new Date(document.values[timestampDimension.key]);
//switch (interval) {
//case 'month':
//case 'day':
// _date.setHours(_date.getHours() - (_date.getTimezoneOffset() / 60));
// return _basedate.getTime() === _date.getTime();
//case 'minute':
// _basedate.setSeconds(0);
// _basedate.setMilliseconds(0);
// return _basedate.getTime() === _date.getTime();
//default:
// _basedate.setMilliseconds(0);
console.log(_basedate.toISOString(), _date.toISOString());
return _basedate.getTime() === _date.getTime();
// }
switch (interval) {
case 'month':
case 'day':
_date.setHours(_date.getHours() - (_date.getTimezoneOffset() / 60));
console.log(_basedate.getTime(), _date.getTime());
return _basedate.getTime() === _date.getTime();
case 'minute':
_basedate.setSeconds(0);
_basedate.setMilliseconds(0);
console.log(_basedate.getTime(), _date.getTime());
return _basedate.getTime() === _date.getTime();
case 'second':
_basedate.setMilliseconds(0);
console.log(_basedate.getTime(), _date.getTime());
return _basedate.getTime() === _date.getTime();
default:
return _basedate.getTime() === _date.getTime();
}
}
catch (ex) {
console.log('exception while checkExists', ex);
Expand Down Expand Up @@ -236,11 +240,7 @@ proto.makeChartTimelineSeries = function (message) {
break;
}

//if (['day', 'month', 'year'].indexOf(interval) > -1)
exists = checkExists(timestampDimension, result.documents, _d, true);
//else
// exists = checkExists(timestampDimension, result.documents, _d);

exists = checkExists(timestampDimension, result.documents, _d);
if (!exists) {
exists = {values: {}, fvalues: {}};
exists.values[timestampDimension.key] = _d.toISOString();
Expand Down

0 comments on commit a34a887

Please sign in to comment.