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

  • 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? 

     

  • jonathan
    Replied on November 23, 2015 at 2: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.

    Initialize date box with beginning date (Sunday) of the week Image 1 Screenshot 20

    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.

  • jonnavarra
    Replied on November 23, 2015 at 2: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

  • David JotForm Support
    Replied on November 23, 2015 at 4: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.