I have a date picker and I want that people can only select days from the current month (depends on the day we are in). Is this possible?

  • luisvallejos13
    Asked on October 30, 2020 at 11:16 PM

    Is there a way to show only the current month?

  • Vick_W Jotform Support
    Replied on October 31, 2020 at 12:02 AM

    Hi there,

    Yes, you can show the current month only by selecting the Start Date and End Date in the LIMITS tab as shown below.

    1604116795 5f9ce13bd49fc  Screenshot 10

    1604116861 5f9ce17d8df3f  Screenshot 21

    Here is the result.

    1604116927 5f9ce1bfd9a8a  Screenshot 32

    You can check it on the demo form below.

    https://form.jotform.com/203039101361036

    Let us know if you have any questions or concerns.

    Thanks.

  • ExperisPE
    Replied on October 31, 2020 at 3:01 PM

    Sorry, maybe I made the wrong question. Is there a way to show current month dynamically. For example, today this will only show October, but tomorrow this will only shows November

  • VincentJay
    Replied on October 31, 2020 at 5:46 PM

    Hi,

    Please provide more information on what you're trying to achieve.

    I am not sure if this is what you're looking for. But, to my understanding, you want to jump dates from October to November by the next day. You can disable dates ranges by using this feature:

    1604180727 5f9ddaf7735d7 vbbdsd4 Screenshot 10


  • ExperisPE
    Replied on October 31, 2020 at 6:40 PM

    Hi. I have a date picker and i want that people can only select days from the current month (depends on the day we are in)

    For example if I fill the form on November 3rd I only could select dates from November. Not other months.

    If I fill the form on December 21st, I only could select dates fron December.

    But I dont want to edit the form every month to change de date limits

  • Patrick_R
    Replied on November 1, 2020 at 12:35 AM

    Hi! Please allow me some time to check if this is possible. I'll get back to you soon with an update.

    Thank you!

  • Patrick_R
    Replied on November 1, 2020 at 2:19 AM

    Hello! This is not directly possible but you can use conditions to implement this functionality. However, you'll still need to make changes per year for this solution.

    Please check this form: https://form.jotform.com/203050894915053

    The error message shows up and the Submit button hides if the selected date is not of the current month.

    Following is the screencast of this form:

    1604215165 5f9e617d3bf7e Screencast 2020 Screenshot 10 If this solves your purpose, then I'll suggest you to clone this form into your account to further check its implementation. Following is how this form works:

    1. This form makes use of hidden date fields.

    2. The first date field is automatically set to the current date.

    3. There are another two date fields, i.e. "Allowed Start Date", "Allowed End Date". Based on the current date set in the first date field, these two fields are set (using conditions).

    These conditions are simple, these just say (for first month):

    IF "current date" IS AFTER "2019-12-31" AND IF "current date" IS before "2020-02-01"
    > Set "Allowed Start Date" TO "2020-01-01"

    IF "current date" IS AFTER "2019-12-31" AND IF "current date" IS before "2020-02-01"
    > Set "Allowed End Date" TO "2020-02-01"

    These conditions are to be set for each month.

    Note: You'll need to manually change "year" value in these conditions each year.

    5. The first 3 date fields are hidden as these are for internal use only.

    4. Once we have our Allowed Start and End Dates, we use simple condition to compare the user selected date with these values and accordingly show Submit button and the Error message.

    I hope this solves your purpose. In case it doesn't or if you have any further questions about this let us know.

    Thank you!