Hey everyone, so I’ve spent about a day or 2 trying to accomplish something that seemed fairly straight forward. I wanted to display a value in my database that was formatted to TIME and not the DATE & TIME, seeing how I need to display items only based on TIME and not specific to a date, since they would be re-occurring, like a schedule. Not only was I able to write code to grab one TIME entry, I was able to write the code to add it to a repeater element. So if you were trying to use a repeater to display out set times or schedule times, etc.
$w("#repeater2").onItemReady( ($item, itemData, index) => {
// Grabs the time field value in your database and adds it to your timepicker. Make sure you ID in properties match
$item("#timePicker3").text = itemData.time;
// Grabs the time field value in your database and adds it to your textbox. Make sure you ID in properties match
$item("#text36").text = itemData.time;
} );
Just make sure you have your repeater, repeater elements and timePicker/Textbox connected to your dataset that is pulling from the database.
I’ve also managed to just pull in one TIME value, but it’ll bring in the most recent time entered value.
$w('#text36').text = $w('#dataset4').getCurrentItem().time;
And last thing to mention, the textbox will display the time as hh:mm:ss:milliseconds. Haven’t attacked that part yet. But hopefully this will help someone that was trying to display time without using the Date & Time field, because they only need to work with time.
FYI, all the photos aren’t showing up because I was too lazy to add the photos to the other entries in the database.