Issue Displaying Date in Text Elements (From Database)

I’m having trouble populating a text field (within a repeater) with a date, which needs to be retrieved from a database.

Here is the text element on the page see the ID “formDate”

Here is the database Field Key and database screenshot. Note the Field Key is “dateField”.

Here is my code:

$w.onReady(function () {
console.log("Start");
	// Get the date from the date field of the current item
const date = $w("#dynamicDataset").getCurrentItem().dateField;
	// Sets formatting options for date
console.log(date);

const options = {
    day: "numeric",
    month: "long",
    year: "numeric"
};
console.log("Set date paramaters");

    // Sets the property of the text element to be a string representing the date in AU English
$w("#formDate").text = date.toLocaleDateString("en-AU", options);

console.log("Converted date to text");

	$w("#VSIRrepeater").onItemReady( ($w, itemData, index) => {
		if($w("#formDescription").text == ""){
			$w("#formDescription").collapse();
		}
        console.log("Collapsed description (if needed)");
        if($w("#formDate").text == ""){
			$w("#formDate").collapse();
		}
        console.log("Collapsed date (if needed)");
	});
});

Based on the console log, it looks like it’s getting stuck at line 4. I suspect it is having an issue retrieving the date from the database, but I can’t figure out why as no errors are displayed. I have also double-checked that the repeater’s ID is “dynamicDataset”.

I followed this tutorial for the date retrieval and formatting - Velo: Formatting Dates | Help Center | Wix.com

Any help would be greatly appreciated.

Thank you