top of page
Forum Posts
Amy Marr
Feb 12, 2020
In Coding with Velo
I need to create an expiration date and store it in a row in a collection using toUpdate. The next expiration date is today's date with one added to the year, the first of the month and the same month. I want it to be stored so that it is later retrievable using $w("#txtexpDate").text = items.expirationDate.toLocaleDateString("en-US", options); which works now.
let expDate = new Date();
// Get new expiration date
expDate.setDate(1);
expDate.setFullYear(items.expirationDate.getFullYear() + 1); //one year later
expDate.setMonth(items.expirationDate.getMonth); //same month next year $w("#txtexpDate").text = expDate.toLocaleDateString("en-US", options); // gives me invalid date let toUpdate = {
"_id": itemsID,
"membershipType": $w("#membershipType").value,
"firstName":$w("#input1").value,
"lastName":$w("#input2").value,
"expirationDate": expDate.text }; // doesn't work Would really appreciate the help... Thank you.
0
2
52
Amy Marr
More actions
bottom of page