Question:
Can someone help me build out a query for checking if current date is passed/not passed the date in the database?
Product:
Editor X
What are you trying to achieve:
- I have a database filled with different access passwords. The database consists of the passwords, a start date and an end date for each code.
- Members visits our site and fills inn an access password
- The code checks if the password is to be found in the database. If so, it checks if the start date has passed and the end date is not passed (is the code valid)
What have you already tried:
So far I have a working solution for checking if the password is to be found in the database.
import wixData from 'wix-data';
$w . onReady ( function () {
$w("#feilmelding").hide();
$w ( "#sjekkKode" ). onClick ( event => {
wixData.query("Smartskole")
.eq("kode", $w("#oppgiKode").value)
.find()
.then((results) => {
if(results.items.length > 0)
$w ("#multiState").changeState ("skjema")
;
else ($w("#feilmelding").show())
})
})
Additional information: