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

17
src/lowTime.js Normal file
View File

@@ -0,0 +1,17 @@
import Datum from "./datum";
function updateLowTime() {
const lowTime= document.getElementById("low-time");
const currentTime = document.getElementById("time").selectedOptions[0].innerText;
if (currentTime.toLowerCase() !== lowTime.innerText) {
lowTime.innerText = currentTime.toLowerCase();
}
}
function updateLowVal(datum) {
const lowVal = document.getElementById("low-val");
lowVal.innerHTML = datum.getPrice().toLocaleString();
}
export {updateLowTime, updateLowVal};