I need to make my spending tracker app better. I'm starting to fall behind on my spending tracking, and that makes me uneasy. Its so fun to work on this site, and I've been pretty consumed with adding pages. The problem with updating my spending tracker app, is that its a vibe coded mess.
Spending toolI want to remake it from scratch, with the principles from How to write the perfect function.
The first thing the program should be able to do is display the current date.
This can be done with the custom function:
Color Code:
Javascript
function calcTodaysDateString() { const today = new Date(); const dateString = today.toLocaleDateString( 'en-US', { year: 'numeric', month: 'long', day: 'numeric' } ); return dateString; } function setElementTextToTodaysDate(elementID) { const dateString = calcTodaysDateString() const elementToChange = document.getElementById(elementID); elementToChange.textContent = `Date: ${dateString}`; } setElementTextToTodaysDate('date-display');