Question:
I use this code to update a collection field with dates but whatever I do it always show a yellow row with an exclamation mark telling me that it needs to be converted to date so please help me with this extremely difficult task. No dataset connected because this is about mapped dates so I can´t choose a specific date field. The code makes the date get into the correct members field cell:
let today = new Date($w(“#engdate”).value); const formattedDate = today.toLocaleDateString(“en-US”, { day: “numeric”, month: “short”, year: “numeric”, }); member[rentalStartField] = today; console.log(“Updated rental start date:”, formattedDate); await wixData.update(“Members”, { …member, …updateData });
Here I show it in another way:
$w(“#engBuy”).onClick(async () => {
let today = new Date($w(“#engdate”).value);
const adjustedDate = today.toLocaleDateString(“en-US”, {
})
member[rentalStartField] = adjustedDate;
console.log(“Updated rental start date:”, adjustedDate);
await wixData.update("Members", { ...member, ...updateData });
Product:
[Wix Editor]
What are you trying to achieve:
[To update the date fields with a correct format value.]