Feat(Home): month selector

This commit is contained in:
Bertrand Benjamin 2019-01-21 12:33:24 +01:00
parent f9c1e6483f
commit c4dbbeaa82
1 changed files with 8 additions and 2 deletions

View File

@ -4,6 +4,8 @@
<div class="analysis" v-if="datas_present">
<b-container fluid>
<b-row class="date-selector">
<b-form-input type="month" value="2018-12" @input="set_month"></b-form-input>
<!--
<b-col sm="1"><label for="start"> Entre </label> </b-col>
<b-col sm="3">
<b-form-input id="start" type="date" :value="start" @input="set_start"></b-form-input>
@ -12,6 +14,7 @@
<b-col sm="3">
<b-form-input id="end" type="date" :value="end" @input="set_end"></b-form-input>
</b-col>
-->
</b-row>
</b-container>
@ -53,6 +56,7 @@
import { mapGetters, mapActions } from 'vuex'
import box from '../components/box'
import tagsComparison from '../components/tags_comparison'
import moment from 'moment'
export default {
name: 'home',
@ -107,10 +111,12 @@ export default {
'set_start',
'set_end'
]),
update_start (e) {
},
set_tags_filter (tagnames) {
this.tags_filter = tagnames
},
set_month (month) {
this.set_start(moment(month).startOf("month").toDate())
this.set_end(moment(month).endOf("month").toDate())
}
}
}