How can I calculate number of days between two dates and the result exclude Saturday and Sunday?

  • himanshugogia
    Asked on May 10, 2016 at 10:59 AM

    Hey,

     

    I need to calculate number of days between two dates and the result shown should exclude Saturday and Sunday.

     

    Please suggest if its possible?

  • KadeJM
    Replied on May 10, 2016 at 11:05 AM

    Do you mean you want to calculate say Wednesday through Saturday counted as 4 Days for instance and show that in the result with Saturday excluded which would technically make that 3 Days?

    Or am I misunderstanding your question? Please feel free to correct me if needed.

  • himanshugogia
    Replied on May 11, 2016 at 6:49 AM

    Yes your understanding is absolutely correct.

    For better clarification suppose I need to calculate number of days from May1-May15. The actual number of days are 15 which is easily displayed but we require an output of 11 days which means between these two days I just want to calculate weekdays.

     

    I hope it clarifies everything.

     

    Regards

  • Welvin Support Team Lead
    Replied on May 11, 2016 at 9:17 AM

    Unfortunately, it's currently not possible when using the DateTime field or any date field in the form builder.

    A workaround would be to use our Date Differences widget: https://widgets.jotform.com/widget/dates_difference. In the widget settings, you can exclude the specific day.

    How can I calculate number of days between two dates and the result exclude Saturday and Sunday? Image 1 Screenshot 20

    The only downside of the widget is you can't see the difference in the form. Only when you receive it through email or in the form submissions page.