Hello, I am building a repeater connected to a data collection. I am not a developer. The “Date and Time” field type produces this in my repeater:
Tue Mar 06 2018 00:00:00 GMT-0500 (Eastern Standard Time)
All I want is the date. For two days I have been reading every post on this topic and trying code suggestions and nothing works yet. I would be so grateful for assistance; this is a show-stopper for me. Here is the last code that I tried:
$w.onReady(function () {
//TODO: write your page related code here…
$w(“#repeater1”).onItemReady( ($w, itemData, index) => {
const monthNames = [“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”];
console.log(itemData.date);
console.log(itemData.date.getDate().toString());
console.log(monthNames[itemData.date.getMonth()]);
console.log(itemData.date.getFullYear().toString());
const strDate = itemData.date.getDate().toString();
const strMonth = monthNames[itemData.date.getMonth()];
const strYear = itemData.date.getFullYear().toString();
$w("#text37").text = strDate + strMonth + strYear;
});
});
And here is the error message in the console:
Loading the code for the Announcements full page page. To debug this code, open tnhqz.js in Developer Tools."2018-03-06T05:00:00.000Z"6March2018"2018-03-05T05:00:00.000Z"5March2018Wix code SDK error: The “src” property cannot be set to “”. It must be a valid URL starting with “http://”, “https://”, or "image://
What am I doing wrong?
Many thanks
Barbara
PS WHEN, oh WHEN, is Wix going to give us more field type choices for date and time?