What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Can I subtract a fixed date from a user entered date field?

    Asked by hilltopkennels on June 26, 2014 at 05:16 PM

    In my Hilltop Kennels Reservation Request form I have a daily heating charge which applies to the days of a multi-day booking which fall in the heating charge period (1st Oct until 30th April).

    For each booking I need to calculate the number of days which lie within the heating charge period in order to calculate the total heating charge.

    For example a booking as follows;

    29th Sept - 3rd Oct would incur a heating charge for 3 days (1st - 3rd Oct)

    or a booking for the following dates;

    29th Apr - 17 May would incur a heating charge for 2 days (29th - 30th Apr)

    a booking for the following dates;

    3rd Nov - 5th Nov would incur a heating charge for 3 days as it falls entirely inside the heating charge period

     

    Thanks to the extra functionality now available within Jotform I have managed to fix all the outstanding issues with the reservation form, this is the only thing I need to crack now!

    Fingers crossed you guys can help!

    Simon

    date field JotForm reservation form calculation date calculation
  • Profile Image
    JotForm Support

    Answered by jonathan on June 26, 2014 at 05:39 PM

    Hi Simon,

    From what I can see in your form https://www.jotform.com/40394782855365, it seems that you have this functionality on the form already?

     

    Please tell us if this is not yet complete.

    And also, I need clarification the "fixed date" variable -- when you say fixed date, does it need not be the current date? I understand it may have impact on the calculation.

    If it only means to be always the current date, then it will be simpler because you can just assigned it on the Date/Time field to use the current date.

    Please inform us if you need further assistance.

    Thanks!

     

     

     

  • Profile Image

    Answered by hilltopkennels on June 27, 2014 at 02:08 AM

    Yes I need the date to be a fixed date, not the current date. i.e. 1st October and 30th April (start and end dates of the chargeable heating days)

  • Profile Image
    JotForm Support

    Answered by jonathan on June 27, 2014 at 05:31 AM

    You can also pre-populate the fixed date using Field Prepopulator App

    By pre-populating the field, you can then assign a fixed date to it that the form user cannot alter.

    Will this solution work for you? Please update us.

    Thanks.

     

  • Profile Image

    Answered by hilltopkennels on July 05, 2014 at 12:21 PM

    I think it will, I'll get back to you once I've had a go and either fixed or need more help! Thanks guys.

  • Profile Image

    Answered by hilltopkennels on July 05, 2014 at 12:58 PM

    Ok I don't think this app will work for me.

    My form asks a user to enter an arrival date and a departure date for their dog (or cat) to be boarded.

    To calculate the fee owed, I need to evaluate how many of the days in the booking lie within the days defined as requiring a heating charge (these are any booking dates between 1st October 2014 and 30th April 2015)

    As far as I can tell (I haven't worked out the logic yet, I would need a hard-coded date of 1st October 2014 and 30th April 2015 set as read-only, hidden fields. Once the user has entered their booking dates the number of days of heating charge can be evaluated.

     

    i.e. booking from 29th September until 3rd Oct

    29th Sep - no heating

    30th Sep - no heating

    1st  Oct - heating charge

    2nd Oct - heating charge

    3rd Oct heating charge

    so a total of 3 x heating charge

     

    so I assume logic will be something like ([1st Oct 2014] - {arrival date}) * {heating charge}

    Problem is it seems to be difficult to have a field with a fixed read only date value

     

    Any ideas?

  • Profile Image
    JotForm Support

    Answered by KadeJM on July 05, 2014 at 04:03 PM

    I think that your mentioned calculation should work, but the problem is that the date needs to be more of a fixed or specific date for this to work otherwise it is going to fall apart after the fact since after looking more at it I believe that this is what is probably causing your issue with it.

    You can probably also work around the date issue by pre-populating the date field which is the hard-coded date you had previously mentioned which should also work. Alternatively, just use it with a text-box field and a fixed date value then you just need to hide it. 

    If that doesn't work then let us know and we will try to test it further to come up with something else.

  • Profile Image

    Answered by hilltopkennels on July 06, 2014 at 03:17 AM

    I'm struggling how to do it, can you assist with the required syntax?

     

    The heating start date is always the same, 1st October 2014. I just need to evaluate how many days (if any) in the booking, fall after 1st October.

  • Profile Image
    JotForm Support

    Answered by jonathan on July 06, 2014 at 06:32 AM

    Hi Simon,

    Let me create a demo form for you that simulate this.

    I will get back to you quickly.

    Thanks.

  • Profile Image

    Answered by hilltopkennels on July 28, 2014 at 02:09 AM

    Any news re the demo form?

  • Profile Image
    JotForm Support

    Answered by ashwin_d on July 28, 2014 at 04:07 AM

    Hello hilltopkennels,

    Your message has reached my colleague @jonathan. He is not available online right now but will get back to you as soon as he is back. I have also sent him a note on this.

    Thank you!

  • Profile Image

    Answered by hilltopkennels on August 10, 2014 at 04:58 AM

    Still not heard anything? Do I assume this isn't possible to do?