Here is my problem, I am trying to develop a Members page that display a little overview of each member of the website, showing the picture, first name, city and age.
I was able to link all fields by simply using the Connect Repeater button.
But the age that is causing the issue.
I was able to get the total age by applying a code to transform the data input by the user to yyyymmdd and then transforming this date to the total age.
But when trying to link this text box that is inside of a repeater, to the code, when previewing, my code works, but it displays the first entry in my dataset, as if everyone has the same age, so it’s not calculating the others.
Anyone had the same issue?
$w.onReady( function () {
// Get the date from the date field of the current item
const date = $w( “#MembrosDataset” ).getCurrentItem().aniversario;
var nowms = Date.now();
var age = Math.floor((nowms - date) / ( 365.25 * 24 * 60 * 60 * 1000 ));
// Set the text element to display the date using the user’s settings
$w( “#AgeField” ).text = age.toString();
});