Show age in days
This commit is contained in:
parent
0201b368d4
commit
324e13f5c5
@ -19,18 +19,36 @@ const OffBudgetAccounts = computed(() => accountStore.OffBudgetAccounts);
|
|||||||
const OnBudgetAccountsBalance = computed(() => accountStore.OnBudgetAccountsBalance);
|
const OnBudgetAccountsBalance = computed(() => accountStore.OnBudgetAccountsBalance);
|
||||||
const OffBudgetAccountsBalance = computed(() => accountStore.OffBudgetAccountsBalance);
|
const OffBudgetAccountsBalance = computed(() => accountStore.OffBudgetAccountsBalance);
|
||||||
|
|
||||||
|
const days = 24 * 60 * 60 * 1000;
|
||||||
|
function daysSinceLastReconciled(account: Account) {
|
||||||
|
if(!account.LastReconciled.Valid)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const now = new Date().getTime();
|
||||||
|
const diff = new Date(now).getTime() - account.LastReconciled.Time.getTime();
|
||||||
|
return Math.floor(diff / days);
|
||||||
|
//const recently = 7 * days;
|
||||||
|
}
|
||||||
|
|
||||||
function isRecentlyReconciled(account: Account) {
|
function isRecentlyReconciled(account: Account) {
|
||||||
if(!account.LastReconciled.Valid)
|
if(!account.LastReconciled.Valid)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const now = new Date().getTime();
|
const now = new Date().getTime();
|
||||||
const recently = 7 * 24 * 60 * 60 * 1000;
|
const recently = 7 * days;
|
||||||
return new Date(now - recently).getTime() < account.LastReconciled.Time.getTime();
|
return new Date(now - recently).getTime() < account.LastReconciled.Time.getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAccountName(account: Account) {
|
function getAccountName(account: Account) {
|
||||||
const reconciledMarker = isRecentlyReconciled(account) ? "" : " *";
|
const days = daysSinceLastReconciled(account);
|
||||||
return account.Name + reconciledMarker;
|
if(days === false)
|
||||||
|
return account.Name + " *";
|
||||||
|
|
||||||
|
if(days <= 7)
|
||||||
|
return account.Name;
|
||||||
|
|
||||||
|
//const reconciledMarker = isRecentlyReconciled(account) ? "" : " *";
|
||||||
|
return account.Name + " " + days;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user