Remaking my budgeting program.

Maybe don't vibe code?

Long story short, I tried vibe coding a javascipt budgeting program. It works, but its written so bad that I cant add on to it easily. But at least its usable, meaning that while I slowly remake it, I won't be bad with money.

Display the current date:

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:

  • functions
  • variables
  • everything else

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');
            
Draw Tile (Next Post) Back to flowchart Back to Home