Setting Up date Display

This is my code so far that is set up for my wix page Date display.

$w.onReady( function () {
$w(“#dataset11”).onReady( () => {
$w(“#dataset1”).forEachItem( ($w) => {
const originalDate = $w(“#DATE”).text;
const newDate = originalDate.split(’ ‘).splice(0, 4).join(’ ‘);
$w(’#DATE’).text = newDate;
console.log('Time removed from Date/Time Stamp: New Date ’ + newDate);
});
});
});

What would i need to add the function to make it output the words like : “one day ago” ?
Integrating with wix would be amazing.

Best

The function forEachItem() is not a valid dataset function. You can learn more about datasets in the wix-dataset API .

For more information on using Dates, see these articles:

Have fun,

Yisrael