Feat: new config
This commit is contained in:
@@ -9,7 +9,7 @@ export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
csv: {},
|
||||
month: moment()
|
||||
month: ''
|
||||
},
|
||||
getters: {
|
||||
csvs: (state) => {
|
||||
@@ -48,9 +48,13 @@ export default {
|
||||
// return data with negatives 'Montant'
|
||||
return getters.rows.filter(x => x.Montant < 0)
|
||||
},
|
||||
month: (state) => {
|
||||
month: (state, getters) => {
|
||||
// month date
|
||||
return state.month
|
||||
if (state.month){
|
||||
return state.month
|
||||
} else {
|
||||
return moment(getters.months.slice(-1)[0], "MMMM YYYY")
|
||||
}
|
||||
},
|
||||
date_filter_rows: (state, getters) => {
|
||||
// return rows filtered by date
|
||||
@@ -214,6 +218,9 @@ export default {
|
||||
prev_month (context) {
|
||||
var prev = moment(context.getters.month).subtract(1, 'months')
|
||||
context.commit('SET_MONTH', { month: prev })
|
||||
},
|
||||
set_month (context, month) {
|
||||
context.commit('SET_MONTH', { month: month })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ export default {
|
||||
'categorie_filter_rows': 'datas/categorie_filter_rows',
|
||||
'datas_present': 'datas/present',
|
||||
'month': 'datas/month',
|
||||
'months': 'datas/months',
|
||||
'tags': 'config/tags',
|
||||
'categories': 'config/categories'
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user