Best Practices

 View Only
  • 1.  Duration Calculation - Days Between Dates

    Posted 12-02-2021 18:32
    Hello ProntoForms Community!
    I am working on a form with a customer which needs a duration calculation between two Date pickers equaling the total days between the dates.
    Currently we can calculate hours using Date/Time pickers, however I am not seeing the option for DAYS.
    I don't think a rounded number of Hours / 24 would really work here either.  A simple example would be check in - check out, number of nights stayed.
    One thought would be to use digit extraction, but I am wondering if anyone else would see value in this as a new feature!

    Best,
    Liam
    ProntoForms

    ------------------------------
    Liam Ohuiginn
    Strategic Account Manager
    ProntoForms
    ------------------------------


  • 2.  RE: Duration Calculation - Days Between Dates

    Staff
    Posted 12-03-2021 12:20

    Hi Liam,

    As of now we can count days with a workaround by counting total seconds in between two selected dates and then divide the total number by 86400.

    This is very easy to achieve with just 4 questions and a couple of calculations.  

    1. Date 1 – Date/Time Selector
    2. Date 2 - Date/Time Selector
    3. Count seconds (can be hidden on device) – Duration Math
    4. Total days – Calculation



    In the third question, please select 'Seconds' as precision which is very important.  This can be changed under question property.

    On the 4th question, click on properties and under Calculation builder please select 3rd question 'Count seconds' and divide it by 68400.

     

    This should display the total number of days on the question 'Total Days'

    Please let me know if you have any other questions or concerns.  



    ------------------------------
    Varun Raval
    Support Analyst
    ProntoForms
    ------------------------------



Reminder: Content posted to our Community is public content.  Please be careful not to post Intellectual Property that you do not have permission sharing.  For more information please refer to our Terms Of Use