Forums

How to prevent a date selection less than 24 hours

spytech 09 Apr, 2018
Hi,

I am trying to get the date selector field to prevent a user selecting weekends and that they must give 24 hours notice based on working days.
I have added the code to Extra Params :

data-open_days=[1,2,3,4,5]
data-start_date=<?php $d = new DateTime('tomorrow'); echo $d->format("d-m-Y"); ?>

This has prevented weekends but still allows them to select the past and the same day. Can anyone help on what I am missing.

Thanks a lot,
P
healyhatman 09 Apr, 2018
edit: dumb suggestion that doesn't work. Proper working solution below.
healyhatman 09 Apr, 2018
Forget all that.

In "Earliest date/time" enter {date:Y-m-d$tomorrow}

Be aware though that it doesn't get the date of your current timezone, for some reason. Gets the date and time in UTC.
This topic is locked and no more replies can be posted.