Skip to content

Commit

Permalink
fix: aligh demo-data with current year
Browse files Browse the repository at this point in the history
minor style adjustments
  • Loading branch information
simonwep committed Oct 27, 2024
1 parent b140c80 commit 9ef58d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/app/components/feature/BudgetGroups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ const reorder = (evt: ReorderEvent) => {
}
> span {
position: absolute;
display: inline-block;
margin-top: -20px;
@include globals.onMobileDevices {
position: static;
Expand Down
12 changes: 4 additions & 8 deletions src/app/pages/dashboard/all-time/AllTime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,14 @@ const cards = computed((): Card[] => {
return [
{
title: t('page.dashboard.yoyIncomeGrowth'),
text: lastYearIncome ? percent.format((currentYearIncome - lastYearIncome) / lastYearIncome) : '',
icon: lastYearIncome
? currentYearIncome > lastYearIncome
? RiArrowUpDoubleLine
: RiArrowDownDoubleLine
: undefined,
text: lastYear ? percent.format((currentYearIncome - lastYearIncome) / lastYearIncome) : '',
icon: lastYear ? (currentYearIncome > lastYearIncome ? RiArrowUpDoubleLine : RiArrowDownDoubleLine) : undefined,
iconClass: currentYearIncome > lastYearIncome ? styles.iconSuccess : styles.iconDanger
},
{
title: t('page.dashboard.yoyExpenseGrowth'),
text: currentYearExpenses ? percent.format((lastYearExpenses - currentYearExpenses) / currentYearExpenses) : '',
icon: currentYearExpenses
text: lastYear ? percent.format((lastYearExpenses - currentYearExpenses) / currentYearExpenses) : '',
icon: lastYear
? lastYearExpenses > currentYearExpenses
? RiArrowUpDoubleLine
: RiArrowDownDoubleLine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ const loadDemoData = async () => {
loading.value = true;
const { default: data } = await import('./DemoData.json');
// Adjust years to match the current year
const year = new Date().getFullYear();
for (let i = 0; i < data.years.length; i++) {
data.years[i].year = year - 1 + i;
}
await deserialize(data as DataStateV3);
loading.value = false;
Expand Down

0 comments on commit 9ef58d3

Please sign in to comment.