How to hide/show element based on the date.

Hi everyone,
I have a database with a date feature and a page with an option to submit a form. I’d like to have a button to access the form but you can only do it if the day hasnt passed.

i.e Database has date field.
if day has not passed show button on page.

Thanks in advance,

You can hide or disable a button if a condition is met with such a code:

if ( startDateTime < Date.now()) {
$w(“#bookButton”).disable();
} else {
$w(“#bookButton”).enable();
}

For details on how to work with date and time in Corvid check out step 14 in the following article: https://support.wix.com/en/article/corvid-tutorial-creating-a-bookings-timetable

If you could please help making it DATE and Time dependent, so lets say the button to appear 60 minutes before startDateTime. Thanking you in advance.