0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🐛 Fixed missing start date in members chart (#1644)

closes https://github.com/TryGhost/Ghost/issues/12014

- `startDateLabel` was never populated after refactoring the members chart to use the members stats service
- use the first date that's returned as part of the members stats days array so that we can account for any potential time period being selected

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
This commit is contained in:
Umur Dinçer 2020-09-22 10:51:29 +03:00 committed by GitHub
parent 8062fa8994
commit 2051b65e51

View file

@ -18,7 +18,15 @@ export default Component.extend({
stats: null,
chartData: null,
chartOptions: null,
startDateLabel: '',
startDateLabel: computed('membersStats.stats', function () {
if (!this.membersStats?.stats?.total_on_date) {
return '';
}
let firstDate = Object.keys(this.membersStats.stats.total_on_date)[0];
return moment(firstDate).format(DATE_FORMAT);
}),
selectedRange: computed('membersStats.days', function () {
const availableRanges = this.availableRanges;