Skip to content

Commit

Permalink
fix: adjust boundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
kptdobe committed Sep 19, 2024
1 parent 3be8e84 commit f65dd9d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tools/rum/charts/skyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,13 @@ export default class SkylineChart extends AbstractChart {
customView = 'hour';
unit = 'hour';
units = 24;
} else if (diff < (1000 * 60 * 60 * 24 * 7)) {
} else if (diff <= (1000 * 60 * 60 * 24 * 7)) {
// less than a week
console.log('chart draw - week view', (diff / (1000 * 60 * 60)));

Check warning on line 503 in tools/rum/charts/skyline.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
customView = 'week';
unit = 'hour';
units = Math.round(diff / (1000 * 60 * 60));
} else if (diff < (1000 * 60 * 60 * 24 * 31)) {
} else if (diff <= (1000 * 60 * 60 * 24 * 31)) {
// less than a month
console.log('chart draw - less than a month');

Check warning on line 509 in tools/rum/charts/skyline.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
customView = 'month';
Expand Down
2 changes: 1 addition & 1 deletion tools/rum/elements/daterange-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export default class TimeRangePicker extends HTMLElement {
if (value === 'week') {
if (!fromElement.value) {
const lastWeek = now;
lastWeek.setHours(-6 * 24, 0, 0, 0);
lastWeek.setHours(-7 * 24, 0, 0, 0);
fromElement.value = toDateString(lastWeek);
}
if (!toElement.value) {
Expand Down
9 changes: 3 additions & 6 deletions tools/rum/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,16 @@ export default class DataLoader {

console.log('fetchPeriod', start.toString(), end.toString());

// for all cases: +2 to cover bondary cases: start and end might be on a different UTC day
// (will be filtered out by start / end range filter)

if (diff < (1000 * 60 * 60 * 24 * 7)) {
if (diff <= (1000 * 60 * 60 * 24 * 7)) {
// less than a week
const days = end.getDate() - start.getDate() + 2;
const days = Math.round((diff / (1000 * 60 * 60 * 24))) + 1;

for (let i = 0; i < days; i += 1) {
console.log('fetching day', start.toString());
promises.push(this.fetchUTCDay(start.toISOString(), originalStart, end));
start.setDate(start.getDate() + 1);
}
} else if (diff < (1000 * 60 * 60 * 24 * 31)) {
} else if (diff <= (1000 * 60 * 60 * 24 * 31)) {
// less than a month
const days = Math.round((diff / (1000 * 60 * 60 * 24))) + 1;

Expand Down

0 comments on commit f65dd9d

Please sign in to comment.