Skip to content

Commit

Permalink
no letters yoseph
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyHubert committed Aug 9, 2024
1 parent 3493ddc commit 4be41d6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions yoseph/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,12 @@ const calculations = () => {
calculations()

document.querySelector(`#savings-expense-enter`).addEventListener(`click`, () => {
const amount = document.querySelector(`#savings-expense-amount`).value
if(!/^[0-9.]+$/.test(amount)) return
const History = getLocalStorage('History', [])
const savingsHistoryItem = {
description: document.querySelector(`#savings-expense-description`).value,
amount: document.querySelector(`#savings-expense-amount`).value*-1,
amount: amount*-1,
date: Date.now(),
account: "savings"
}
Expand All @@ -130,10 +132,12 @@ document.querySelector(`#savings-expense-enter`).addEventListener(`click`, () =>
})

document.querySelector(`#pay-enter`).addEventListener(`click`, () => {
const amount = document.querySelector(`#pay-amount`).value
if(!/^[0-9.]+$/.test(amount)) return
const History = getLocalStorage('History', [])
const paydayHistoryItem = {
description: 'payday',
amount: document.querySelector(`#pay-amount`).value,
amount: amount,
date: Date.now(),
account: "payday"
}
Expand All @@ -144,10 +148,12 @@ document.querySelector(`#pay-enter`).addEventListener(`click`, () => {
})

document.querySelector(`#stupid-expense-enter`).addEventListener(`click`, () => {
const amount = document.querySelector(`#stupid-expense-amount`).value
if(!/^[0-9.]+$/.test(amount)) return
const History = getLocalStorage('History', [])
const stupidHistoryItem = {
description: document.querySelector(`#stupid-expense-description`).value,
amount: document.querySelector(`#stupid-expense-amount`).value*-1,
amount: amount*-1,
date: Date.now(),
account: "stupid"
}
Expand Down

0 comments on commit 4be41d6

Please sign in to comment.