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

  • windymile
    Asked on March 5, 2019 at 2: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.

  • Elton Support Team Lead
    Replied on March 5, 2019 at 3: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.

    Can Datepicker knew the difference between a weeknight and a weekend night? Image 1 Screenshot 20

    If you have any other questions, let us know.

  • windymile
    Replied on March 5, 2019 at 5: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!!
    ...
  • jherwin
    Replied on March 5, 2019 at 6: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.

  • windymile
    Replied on March 5, 2019 at 7: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
    ...
  • jherwin
    Replied on March 5, 2019 at 9: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.