# Datepicker question

**URL:** https://community.glideapps.com/t/datepicker-question/67971
**Category:** Ask for Help
**Created:** [November 20, 2023, 2:53pm UTC](https://community.glideapps.com/t/datepicker-question/67971 "2023-11-20T14:53:13Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)
#### Post date: [November 20, 2023, 2:53pm UTC](https://community.glideapps.com/t/datepicker-question/67971/1 "2023-11-20T14:53:14Z")

</div>

I have built a shop. People can choose a pickup date. But shouldn’t be able to pick a data less than 5 dates from now. How would you only give them the option to pick a day 5+ days from now?

---

<div class="post-metadata">

### Author: ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)
#### Post date: [November 20, 2023, 3:50pm UTC](https://community.glideapps.com/t/datepicker-question/67971/2 "2023-11-20T15:50:31Z")

</div>

5 days or 5 business days?

---

<div class="post-metadata">

### Author: ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)
#### Post date: [November 20, 2023, 3:51pm UTC](https://community.glideapps.com/t/datepicker-question/67971/3 "2023-11-20T15:51:35Z")

</div>

5 days is fine, shop is open 7 days a week!

---

<div class="post-metadata">

### Author: ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)
#### Post date: [November 20, 2023, 3:55pm UTC](https://community.glideapps.com/t/datepicker-question/67971/4 "2023-11-20T15:55:27Z")

</div>

I think the best you could do with the date picker is to show something like a hint component if the date is out of range.

To add 5 days to todays date you could use a math column… Now+5… or (order created on date+5)

If you’re using a custom form you could also restrict the submit button.

---

<div class="post-metadata">

### Author: ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)
#### Post date: [November 20, 2023, 3:56pm UTC](https://community.glideapps.com/t/datepicker-question/67971/5 "2023-11-20T15:56:51Z")

</div>

Thanks! I’m going to try!

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [November 20, 2023, 4:39pm UTC](https://community.glideapps.com/t/datepicker-question/67971/6 "2023-11-20T16:39:30Z")

</div>

Whichever way you go with this, you will need a Custom Form. Otherwise it’s impossible to compare the selected date to any other date until after the form is submitted.

---

<div class="post-metadata">

### Author: ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)
#### Post date: [November 20, 2023, 4:51pm UTC](https://community.glideapps.com/t/datepicker-question/67971/7 "2023-11-20T16:51:19Z")

</div>

Ah good to know!

---

<div class="post-metadata">

### Author: ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)
#### Post date: [November 21, 2023, 10:03am UTC](https://community.glideapps.com/t/datepicker-question/67971/8 "2023-11-21T10:03:53Z")

</div>

But is it possible to only filter dates that are NOW+5 or more?If so how? Thanks in advance!

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [November 21, 2023, 12:57pm UTC](https://community.glideapps.com/t/datepicker-question/67971/9 "2023-11-21T12:57:42Z")

</div>

No you can’t filter dates in a date picker. Best you can do run edit checks after a date has been selected to determine if it’s in range or not.

---

<div class="post-metadata">

### Author: ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)
#### Post date: [November 21, 2023, 12:58pm UTC](https://community.glideapps.com/t/datepicker-question/67971/10 "2023-11-21T12:58:38Z")

</div>

Thank you!

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [November 21, 2023, 1:05pm UTC](https://community.glideapps.com/t/datepicker-question/67971/11 "2023-11-21T13:05:58Z")

</div>

- Create a Math column using `Now+5`. That will give you the date 5 days from now.
- In your Custom Form, you’ll be collecting a date from the user in a User Specific Column
- Create an if-then-else column:  
– If user selected date is on or after math column (now+5), then true
- Now you can use that if-then-else column as a condition on your Submit button. ie. don’t allow the action unless the if-then-else is checked.
- You could also add a hint component to your form to warn when they have selected an “invalid” date, and use the same if-then-else column as a visibility condition on the hint.

---

<div class="post-metadata">

### Author: ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)
#### Post date: [November 21, 2023, 9:55pm UTC](https://community.glideapps.com/t/datepicker-question/67971/12 "2023-11-21T21:55:51Z")

</div>

Thanks a lot Darren!

---

<div class="post-metadata">

### Author: ![AdamMartin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/adammartin/32/66650_2.png) [@AdamMartin](https://community.glideapps.com/u/AdamMartin)
#### Post date: [November 21, 2023, 10:11pm UTC](https://community.glideapps.com/t/datepicker-question/67971/13 "2023-11-21T22:11:19Z")

</div>

An alternative approach might be to limit the dates that they can pick up. In most cases people will want to pick up on a certain day of the week rather than a particular date. So you could build up a list of dates from a date 5 days after they place their order. Something like 14 days worth would capture most peoples preference… a final “choice” could say “After xx date” where xx date is the 14th date.

This would then be presented as a simple drop down or choice list.

The benefit of this approach is you will not be holding the order for a pick up long into the future. And can avoid a user accidentally choosing the wrong date. From a store point of view, you don’t want to be managing to many orders awaiting pick up either.

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [November 22, 2023, 3:01am UTC](https://community.glideapps.com/t/datepicker-question/67971/14 "2023-11-22T03:01:49Z")

</div>

I wouldn’t use a date picker for this. I’d use a choice component instead.

---

<div class="post-metadata">

### Author: ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)
#### Post date: [November 22, 2023, 7:18am UTC](https://community.glideapps.com/t/datepicker-question/67971/15 "2023-11-22T07:18:03Z")

</div>

So say I want people to choose from X days after NOW+5, how would you do that Robert?  
How would generate the dates and how limit the choices?  
Thanks!

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [November 22, 2023, 7:25am UTC](https://community.glideapps.com/t/datepicker-question/67971/16 "2023-11-22T07:25:51Z")

</div>

Use a Helper Table 😉

- Add as many rows as you need (the number of dates you want to make available)
- Number your rows, from 0 to N
- Add a math column using the formula `Now+5+N`, where N is the row number
- Use that in your Choice component

---

<div class="post-metadata">

### Author: ![erwblo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/erwblo/32/75_2.png) [@erwblo](https://community.glideapps.com/u/erwblo)
#### Post date: [November 22, 2023, 7:42am UTC](https://community.glideapps.com/t/datepicker-question/67971/17 "2023-11-22T07:42:00Z")

</div>

Thanks to you I use a helper table for everything! 🙂  
I am going to try this and will get there in the end 🙂
