• Resolved Graicifyd

    (@graicifyd)


    Hello,

    I was trying to subtract two date fields that have only time option checked but the I am getting incorrect results in decimals. Please what can I do.

    I need the difference between two time fields. fieldname 2 – fieldname1 (with only time option checked)

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Graicifyd

    (@graicifyd)

    I will also like to set one of the date fields to show the current time. I can show set the default date to current day with ‘1’ how can I set the current time as default?

    Plugin Author codepeople

    (@codepeople)

    Hello @graicifyd

    Please, edit the equation a follows:

    
    (function(){
        var d = ABS(fieldname1-fieldname2)*86400, 
        h = FLOOR(d/(60*60)),
        m = ROUND(d%(60*60)/60);
        return IF(h<10, '0'+h, h)+':'+IF(m<10, '0'+m, m);
    })()
    

    By default, the selected time in the date/time fields would be the current time.

    Best regards.

    Thread Starter Graicifyd

    (@graicifyd)

    Thank you.

    I have tried it but the difference remains as 00:00, see the calculator here on the second page.

    Due time is Fieldname102

    the Default time is the one below which is fieldname103

    I intend finding the difference between the due time selected and the default time, it’s only the difference in hour I need, I don’t need the minute.

    Thank you for your support.

    Th

    Plugin Author codepeople

    (@codepeople)

    Hello @graicifyd

    Please, even if you’ve configured the date/time fields to display only the time components, you should tick the choices for the days (Sun, Mon, Tue, Wed, Thu, Fri, Sat) in their settings.

    Best regards.

    Thread Starter Graicifyd

    (@graicifyd)

    Thanks, this worked perfectly.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Hour TIme Addition’ is closed to new replies.