Trying to do a simple age calculator,for some reason the code can’t recognise the birthDay field from the database,although it is written exactly as it is.
Can anyone point me in the right direction?
I got a datepicker user input for the birthday part and a text for the age box display,both connected to the database
import wixData from "wix-data";
$w.onReady( async function () {
var dobms = $w("#dataset1").birthDay.value.valueOf();
var nowms = Date.now();
var age = Math.floor((nowms - dobms) / (365.25 * 24 * 60 * 60 * 1000));
$w("#ageBox").text = age.toString();
});
Thank you