Hi all,

I tried the 2 JavaScript sample in the following links, but none of them work.

http://dev.joget.org/community/display/KBv4/Calculate+Date+Range

http://dev.joget.org/community/display/KBv4/Date+Picker+-+Compare+Date

Those code were put into a Custom HTML field within a form, and I had changed the related date picker field to the names according to the sample shows.

Is there any thing else i need to do beside just copy the code in the Custom HTML field?

Thanks!

Gilbert

  • No labels

2 Comments

  1. Hello Gilbert,

    I tried the sample, but in my case it works fine. Let me put down the steps for you again:
    1.Add two datePickers with ids : 'fromDatepicker' & 'toDatepicker'
    2.Add a textField with id : 'days'
    3.Add a customHTML field to the form and between the <script type="text/javascript"></script> tags, paste the contents of the script given in the URL: Calculate Date Range.

    Hope this helps,

    Regards,
    Ashutosh

  2. Please help me this case. 

    I used the same code given and it works. However, the result is not quite ok. If I select start_date is 01.01.2016 and end_date is 01.01.2016 then the result is 0. Well the result should be 1.

    Second, the code should not calculate the weekend as well.

    Please help

    Thank you