Block off certain dates on the date picker?

Hello all!

I’m wondering if someone might be able to give me a hand and I’m hoping this is the appropriate place to ask (??). I have a client who offers catering services and has a basic web form on their site that includes a date picker. However, the client requires at least 7 days notice for catering services, so we’d like to ‘grey out’ any dates that are not at least 7 days out from the current date. Is there a way to accomplish something like this with either Liquid or Javascript (or a combo of both)?

I would appreciate any help/direction anyone can provide. Thank you in advance!

Hi @StudioRTP

You can add native attributes to the date input to control date ranges available, like MIN and MIX:

But for greater control, you might want to use a javascript date picker plugin that offers these types of controls as well.
I think I’ve used this one before to good effect:

1 Like

Perfect - thank you Adam! I will look this over, I just thought I’d check to see if there was a quick/easy way to do this by wrapping the field in some sort of Liquid logic. I’ll read this over and get to work - thank you!

1 Like