formatting the date of reviews on a repeater

@shan

This is my code and my repeater. trying to change the date from the full long version to jus the first line of day month year.

thanks.

Under your dataset’s onReady function do this:

export function dataset1_ready() {
    $w("#repeater1").onItemReady( ($item, itemData, index) => {
    $w("#repeater1").forEachItem( () => {
         var newDate = new Date($item("#date").text); //creating a js date instance
         $item("#date").text = String(newDate.toDateString()); //setting the date
    });
});
}

This will give you the date in American English: Tue Mar 12 2019

1 Like