diff --git a/web/src/pages/BudgetSidebar.vue b/web/src/pages/BudgetSidebar.vue index e9125e4..db6fd09 100644 --- a/web/src/pages/BudgetSidebar.vue +++ b/web/src/pages/BudgetSidebar.vue @@ -2,7 +2,7 @@ import { computed } from "vue"; import Currency from "../components/Currency.vue" import { useBudgetsStore } from "../stores/budget" -import { useAccountStore } from "../stores/budget-account" +import { Account, useAccountStore } from "../stores/budget-account" import { useSettingsStore } from "../stores/settings" const ExpandMenu = computed(() => useSettingsStore().Menu.Expand); @@ -16,6 +16,18 @@ const OnBudgetAccounts = computed(() => accountStore.OnBudgetAccounts); const OffBudgetAccounts = computed(() => accountStore.OffBudgetAccounts); const OnBudgetAccountsBalance = computed(() => accountStore.OnBudgetAccountsBalance); const OffBudgetAccountsBalance = computed(() => accountStore.OffBudgetAccountsBalance); + +function isRecentlyReconciled(account : Account) { + const now = new Date().getTime(); + const recently = 7 * 24 * 60 * 60 * 1000; + console.log(account.Name, account.LastReconciled, now, recently, new Date(now-recently)); + return new Date(now - recently).getTime() < account.LastReconciled.getTime(); +} + +function getAccountName(account : Account) { + const reconciledMarker = isRecentlyReconciled(account) ? "" : " *"; + return account.Name + reconciledMarker; +}