Adds a high and low price data callout

This commit is contained in:
2024-10-16 23:53:53 -07:00
parent 487bb86a29
commit 5abf6fe132
6 changed files with 126 additions and 25 deletions

18
src/highTime.js Normal file
View File

@@ -0,0 +1,18 @@
import Datum from "./datum";
function updateHighTime() {
const highTime= document.getElementById("high-time");
const currentTime = document.getElementById("time").selectedOptions[0].innerText;
if (currentTime.toLowerCase() !== highTime.innerText) {
highTime.innerText = currentTime.toLowerCase();
}
}
function updateHighVal(datum) {
const highVal = document.getElementById("high-val");
highVal.innerHTML = datum.getPrice().toLocaleString();
}
export {updateHighTime, updateHighVal};