Skip to content

Commit

Permalink
fix: add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alchez committed Feb 17, 2022
1 parent 961d02a commit 71a3329
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 6 deletions.
12 changes: 12 additions & 0 deletions dist/frappe-charts.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3103,6 +3103,7 @@ class Heatmap extends BaseChart {
const [startMonth, startYear] = [s.start.getMonth(), s.start.getFullYear()];
const [endMonth, endYear] = [s.end.getMonth(), s.end.getFullYear()];

console.log("STATE: ", s);
const noOfMonths = (endMonth - startMonth + 1) + (endYear - startYear) * 12;

let domainConfigs = [];
Expand All @@ -3120,6 +3121,7 @@ class Heatmap extends BaseChart {
startOfMonth = endDate;
}

console.log("DOMAIN CONFIGS: ", domainConfigs);
return domainConfigs;
}

Expand All @@ -3136,12 +3138,16 @@ class Heatmap extends BaseChart {
addDays(endDate, 1);
let noOfMonthWeeks = getWeeksBetween(startOfWeek, endDate);

console.log("START DATE: ", startDate);
console.log("END DATE: ", endDate);
let cols = [], col;
for(var i = 0; i < noOfMonthWeeks; i++) {
col = this.getCol(startOfWeek, month);
console.log("COL: ", col);
cols.push(col);

startOfWeek = toMidnightUTC(new Date(col[NO_OF_DAYS_IN_WEEK - 1].yyyyMmDd));
console.log("START OF WEEK: ", startOfWeek);
addDays(startOfWeek, 1);
}

Expand All @@ -3150,6 +3156,7 @@ class Heatmap extends BaseChart {
cols.push(this.getCol(startOfWeek, month, true));
}

console.log("DOMAIN CONFIG: ", domainConfig);
domainConfig.cols = cols;

return domainConfig;
Expand All @@ -3160,19 +3167,24 @@ class Heatmap extends BaseChart {

// startDate is the start of week
let currentDate = clone(toMidnightUTC(startDate));
console.log("CURRENT DATE: ", currentDate);
let col = [];

for(var i = 0; i < NO_OF_DAYS_IN_WEEK; i++, addDays(currentDate, 1)) {
let config = {};

// Non-generic adjustment for entire heatmap, needs state
let currentDateWithinData = currentDate >= s.start && currentDate <= s.end;
console.log("CURRENT DATE WITHIN DATA: ", currentDateWithinData);

if(empty || currentDate.getMonth() !== month || !currentDateWithinData) {
console.log("1");
config.yyyyMmDd = getYyyyMmDd(currentDate);
} else {
console.log("2");
config = this.getSubDomainConfig(currentDate);
}
console.log("CONFIG: ", config);
col.push(config);
}

Expand Down
2 changes: 1 addition & 1 deletion dist/frappe-charts.min.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/frappe-charts.min.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/frappe-charts.min.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/frappe-charts.min.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/js/frappe-charts.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/js/frappe-charts.min.js.map

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions src/js/charts/Heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export default class Heatmap extends BaseChart {
const [startMonth, startYear] = [s.start.getMonth(), s.start.getFullYear()];
const [endMonth, endYear] = [s.end.getMonth(), s.end.getFullYear()];

console.log("STATE: ", s);
const noOfMonths = (endMonth - startMonth + 1) + (endYear - startYear) * 12;

let domainConfigs = [];
Expand All @@ -230,6 +231,7 @@ export default class Heatmap extends BaseChart {
startOfMonth = endDate;
}

console.log("DOMAIN CONFIGS: ", domainConfigs);
return domainConfigs;
}

Expand All @@ -246,12 +248,16 @@ export default class Heatmap extends BaseChart {
addDays(endDate, 1);
let noOfMonthWeeks = getWeeksBetween(startOfWeek, endDate);

console.log("START DATE: ", startDate);
console.log("END DATE: ", endDate);
let cols = [], col;
for(var i = 0; i < noOfMonthWeeks; i++) {
col = this.getCol(startOfWeek, month);
console.log("COL: ", col);
cols.push(col);

startOfWeek = toMidnightUTC(new Date(col[NO_OF_DAYS_IN_WEEK - 1].yyyyMmDd));
console.log("START OF WEEK: ", startOfWeek);
addDays(startOfWeek, 1);
}

Expand All @@ -260,6 +266,7 @@ export default class Heatmap extends BaseChart {
cols.push(this.getCol(startOfWeek, month, true));
}

console.log("DOMAIN CONFIG: ", domainConfig);
domainConfig.cols = cols;

return domainConfig;
Expand All @@ -270,19 +277,24 @@ export default class Heatmap extends BaseChart {

// startDate is the start of week
let currentDate = clone(toMidnightUTC(startDate));
console.log("CURRENT DATE: ", currentDate);
let col = [];

for(var i = 0; i < NO_OF_DAYS_IN_WEEK; i++, addDays(currentDate, 1)) {
let config = {};

// Non-generic adjustment for entire heatmap, needs state
let currentDateWithinData = currentDate >= s.start && currentDate <= s.end;
console.log("CURRENT DATE WITHIN DATA: ", currentDateWithinData)

if(empty || currentDate.getMonth() !== month || !currentDateWithinData) {
console.log("1")
config.yyyyMmDd = getYyyyMmDd(currentDate);
} else {
console.log("2")
config = this.getSubDomainConfig(currentDate);
}
console.log("CONFIG: ", config);
col.push(config);
}

Expand Down

0 comments on commit 71a3329

Please sign in to comment.