top of page

Forum Posts

maddie
Apr 18, 2024
In Velo (Wix Code)
I have a repeater that is populated with data from a .json feed. There is a start_date field that contains quote text with the date and time of an event. Currently the time is displayed in a 24-hour format, and I was wondering if it was possible to display it in an am/pm format, or if I couldn't change it because it was quote text? I was also wondering if it was possible to change the date's format from YYYY-MM-DD to MM-DD-YYYY. I'm very new to coding, so I have no idea if what I'm wanting is even doable. :) My current code for my repeater: import { getEvents } from 'backend/events.jsw' $w.onReady (function () { $w('#eventsRepeater').onItemReady(($item,itemData,index) => { $item('#eventImage').src = itemData.image $item('#eventTitle').text = itemData.title $item('#eventInfo').text = itemData.description $item('#eventDate').text = itemData.start_date }); const populateRepeater = async ()=>{ const events = await getEvents(); const eventData = events.map((char)=> char = {...char, _id: char.id.toString()}); $w('#eventsRepeater').data = eventData } populateRepeater(); }); Thanks!
Changing Date/Time Format of Third-Party Data content media
0
1
12

maddie

More actions
bottom of page