Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always show period in FinancialOverview #73

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions Website/ui/src/modules/Dashboard/FinancialOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
v-model="period.from"
md-immediately
v-validate="'required'"
data-vv-name="periodFrom"
>
<label>{{ $tc('phrases.fromDate') }}</label>
</md-datepicker>
Expand All @@ -28,6 +29,7 @@
v-model="period.to"
md-immediately
v-validate="'required'"
data-vv-name="periodTo"
>
<label>{{ $tc('phrases.toDate') }}</label>
</md-datepicker>
Expand Down Expand Up @@ -108,7 +110,6 @@ export default {
},
loading: false,
setPeriod: false,
periodText: '-',
disabled: {
customPredictor: function (date) {
let today = new Date()
Expand All @@ -134,12 +135,21 @@ export default {
this.clusterService.financialData = newVal
},
},
mounted() {
let currentDate = new Date()
// Set the time frame to show past 3 month until today
let startDate = new Date(
currentDate.getFullYear(),
currentDate.getMonth() - 2,
1,
)
let endDate = currentDate

this.setDate(startDate, 'from')
this.setDate(endDate, 'to')
},
methods: {
showPeriod() {
this.period = {
from: null,
to: null,
}
this.setPeriod = !this.setPeriod
},
async getClusterFinancialData() {
Expand All @@ -157,9 +167,6 @@ export default {
? moment(this.period.to).format('YYYY-MM-DD')
: null
this.periodChanged(from, to)
if (from !== null) {
this.periodText = from + ' - ' + to
}
this.setPeriod = false
this.loading = false
},
Expand All @@ -180,6 +187,9 @@ export default {
},
},
computed: {
periodText() {
return this.period.from + ' - ' + this.period.to
},
lineChartData() {
return this.clusterService.lineChartData(true)
},
Expand Down
Loading