Can Datepicker knew the difference between a weeknight and a weekend night?

  • Profile Image
    windymile
    Asked on March 05, 2019 at 02:19 PM

    it sure would be nice if the datepicker already knew the
    difference between a weeknight and a weekend night as I charge a
    different rate for the different nights.

  • Profile Image
    EltonCris
    Answered on March 05, 2019 at 03:12 PM

    You can create an Update/Calculate Field condition that if the selected day on the date picker field is equal to Saturday or Sunday, you can do specific calculations.

    If you have any other questions, let us know.

  • Profile Image
    windymile
    Answered on March 05, 2019 at 05:43 PM
    I am probably making this more difficult than it need to be.
    My form is here
    https://form.jotform.com/90634940417155
    Currently, I am multiplying total nights x a single price.
    the user has to tell me if one of the nights is a weekend night. This
    is sort of crude. I feel like there is a workaround.
    I made a field called weekday price, and pre-populated it with a price.
    then I added a condition to send that weekday price to an empty field
    called weekdays.
    Now .... how do I replace my "single" price with two differing prices
    and populate the "total" price based on users input?
    Thanks for all your help!!
    ...
  • Profile Image
    jherwin
    Answered on March 05, 2019 at 06:54 PM

    Could you please check my demo form here: https://form.jotform.com/90637670149968

    Please select "Friday" for arrival date and "Sunday" for depart. The output should be "both" since they will be staying Friday night and Saturday night.

    Please give it a try and let us know if you are referring to that.

  • Profile Image
    windymile
    Answered on March 05, 2019 at 07:43 PM
    That is great! but what if I select a thurs thru a tues 7th thru 12th?
    clearly, two weekend nights have been selected,
    .... but the field is empty ...... hmmm
    any thoughts.
    btw, I am amazed at your willingness to help with this!!!
    and I love conditional logic challenges.
    this is fun
    ...
  • Profile Image
    jherwin
    Answered on March 05, 2019 at 09:06 PM

    You're right, it is not possible to get how many weekend night they'll stay if they choose a date as you mentioned.

    If you are familiar with Javascript or another programming language, this could be possible if you'll use the form's full source code.

    I see a similar discussion in this link, you can then use the Javascript function getDay() to identify the day of that date. This might be too technical and will need more time to research, but I hope it gives you an idea.