Fix barchart bugs (#7063)

* ensure dropdown works in storybook by handling Dates and strings

* camelcase fix

* ensure tooltip doesn't blink
This commit is contained in:
Noelle Daley 2019-07-03 13:52:56 -07:00 committed by GitHub
parent d9113f1668
commit 1760c321db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -34,9 +34,9 @@ export default Component.extend({
let filteredCounters = [];
if (timeWindow === 'Last 12 Months') {
const today = new Date();
const TwelveMonthsAgo = addMonths(today, -12);
const twelveMonthsAgo = addMonths(today, -12);
filteredCounters = counters.filter(counter => {
return isWithinRange(counter.start_time, TwelveMonthsAgo, today);
return isWithinRange(counter.start_time, twelveMonthsAgo, today);
});
return filteredCounters;

View File

@ -27,7 +27,12 @@ export default Component.extend({
let counters = this.counters || [];
let options = [];
if (counters.length) {
const years = counters.map(counter => counter.start_time.substr(0, 4)).uniq();
const years = counters
.map(counter => {
const year = new Date(counter.start_time);
return year.getUTCFullYear();
})
.uniq();
years.sort().reverse();
options = options.concat(years);
}

View File

@ -44,6 +44,7 @@
background: $grey;
color: $ui-gray-010;
border-radius: 2px;
pointer-events: none !important;
}
/* Creates a small triangle extender for the tooltip */