Initialize date box with beginning date (Sunday) of the week

  • Profile Image
    jonnavarra
    Asked on November 23, 2015 at 12:40 PM

    Hello

    How do I dynamically set the date in the FROM date box to Sunday and TO date box to Saturday? 

     

  • Profile Image
    jonathan
    Answered on November 23, 2015 at 02:15 PM

    The DateTime field default starting day of the week is always set at Sunday.

    You can change it to Monday as the other option. This can be done in the Properties of the field.

    There is also option to manipulate most of the dates available to the field using its "Limit Dates' feature.

    user guide: -How-to-Use-the-Limit-Dates-feature-in-a-DateTime-field

    Hope this help. Let us know if you need further assistance.

  • Profile Image
    jonnavarra
    Answered on November 23, 2015 at 02:29 PM

    I'm afraid I wasn't very clear with my inquiry.

    I have a From and To date fields. I wanted the date in the From field to show the date of the Sunday in the week, and the To date field the Saturday date in that week. 

    This week, for example;

    FROM: November 22, 2015

        TO: November 28, 2015

     

    Next week;

    FROM: November 29, 2015

        TO: December 05, 2015

  • Profile Image
    david
    Answered on November 23, 2015 at 04:03 PM

    There is a workaround described in this thread:

    https://www.jotform.com/answers/647035-set-conditions-on-date-field-to-calculate-delivery-date

    That should be what you are looking for.  Your set up would also require an additional condition for each day and a second field to show the "to" date. 

    Essentially, you would have a "Date" field that always shows the current date.  Based on the day of the week, you other two fields would be populated with (current date + appropriate number of days to get Sunday) and (current date + appropriate number of days to get Saturday).

    I hope this makes sense.  If you have any further questions, le tus know and we will be happy to help.