Revert
All checks were successful
continuous-integration/drone/push Build is passing
ci/woodpecker/push/woodpecker Pipeline was successful
continuous-integration/drone/pr Build is passing
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
Jan Bader 2022-02-14 22:39:14 +00:00
parent 0a030eaee1
commit 87a70ee5fa

View File

@ -18,16 +18,9 @@ const props = defineProps<{
const budgetsStore = useBudgetsStore(); const budgetsStore = useBudgetsStore();
const CurrentBudgetID = computed(() => budgetsStore.CurrentBudgetID); const CurrentBudgetID = computed(() => budgetsStore.CurrentBudgetID);
const accountStore = useAccountStore(); const categoriesForMonth = useAccountStore().CategoriesForMonth;
//const categoriesForMonth = accountStore.CategoriesForMonth;
const Categories = computed(() => { const Categories = computed(() => {
const yearMap = accountStore.Months.get(selected.value.Year); return [...categoriesForMonth(selected.value.Year, selected.value.Month)];
const monthMap = yearMap?.get(selected.value.Month);
console.log("MTH", monthMap)
const CategoriesForMonth = [ ...monthMap?.values() || [] ];
console.log("YAY?")
return CategoriesForMonth;
//return [...categoriesForMonth(selected.value.Year, selected.value.Month)];
}); });
const previous = computed(() => ({ const previous = computed(() => ({
Year: new Date(selected.value.Year, selected.value.Month - 1, 1).getFullYear(), Year: new Date(selected.value.Year, selected.value.Month - 1, 1).getFullYear(),
@ -39,7 +32,7 @@ const current = computed(() => ({
})); }));
const selected = computed(() => ({ const selected = computed(() => ({
Year: Number(props.year) ?? current.value.Year, Year: Number(props.year) ?? current.value.Year,
Month: Number(props.month ?? current.value.Month) + 1 Month: Number(props.month ?? current.value.Month)
})); }));
const next = computed(() => ({ const next = computed(() => ({
Year: new Date(selected.value.Year, Number(props.month) + 1, 1).getFullYear(), Year: new Date(selected.value.Year, Number(props.month) + 1, 1).getFullYear(),
@ -57,7 +50,7 @@ watchEffect(() => {
</script> </script>
<template> <template>
<h1>Budget for {{ selected.Month }}/{{ selected.Year }}</h1> <h1>Budget for {{ selected.Month + 1 }}/{{ selected.Year }}</h1>
<div> <div>
<router-link <router-link
:to="'/budget/' + CurrentBudgetID + '/budgeting/' + previous.Year + '/' + previous.Month" :to="'/budget/' + CurrentBudgetID + '/budgeting/' + previous.Year + '/' + previous.Month"