Skip to content

Commit

Permalink
fix(axis): fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdickerson committed Dec 12, 2019
1 parent 8cfa595 commit f810d4a
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions packages/core/src/components/axes/axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,24 +148,24 @@ export class Axis extends Component {

if (axisOptions.scaleType === ScaleTypes.TIME) {
if (Tools.getProperty(options, "timeScale", "addSpaceOnEdges")) {
const startDate = new Date(domain[0]);
const endDate = new Date(domain[1]);
if (differenceInYears(endDate, startDate) > 3) {
return [subYears(startDate, 1), addYears(endDate, 1)];
}
if (differenceInMonths(endDate, startDate) > 3) {
return [subMonths(startDate, 1), addMonths(endDate, 1)];
}
if (differenceInDays(endDate, startDate) > 3) {
return [subDays(startDate, 1), addDays(endDate, 1)];
} else if (differenceInHours(endDate, startDate) > 3) {
return [subHours(startDate, 1), addHours(endDate, 1)];
} else if (differenceInMinutes(endDate, startDate) > 3) {
return [subMinutes(startDate, 1), addMinutes(endDate, 1)];
}
// Other
return [startDate, endDate];
}
const startDate = new Date(domain[0]);
const endDate = new Date(domain[1]);
if (differenceInYears(endDate, startDate) > 3) {
return [subYears(startDate, 1), addYears(endDate, 1)];
}
if (differenceInMonths(endDate, startDate) > 3) {
return [subMonths(startDate, 1), addMonths(endDate, 1)];
}
if (differenceInDays(endDate, startDate) > 3) {
return [subDays(startDate, 1), addDays(endDate, 1)];
} else if (differenceInHours(endDate, startDate) > 3) {
return [subHours(startDate, 1), addHours(endDate, 1)];
} else if (differenceInMinutes(endDate, startDate) > 3) {
return [subMinutes(startDate, 1), addMinutes(endDate, 1)];
}
// Other
return [startDate, endDate];
}

}

Expand Down

0 comments on commit f810d4a

Please sign in to comment.