Is it possible to use the calculation field to ge the day of the week

  • Profile Image
    beatsahead
    Asked on September 29, 2015 at 02:05 PM

    I currently have 3 different pricing structures

    Low - Mon-Thurs

    Mid - Fri/Sun

    High - Sat

    Is there any way to use the calculation field (or anything else) to select the correct day of the week when the user enters their date.

    It is further complicated that all of December is at high rate.

  • Profile Image
    KadeJM
    Answered on September 29, 2015 at 03:15 PM

    I believe you are saying that you want to try to create a calculation that can obtain the appropriate day of the week based on the current date.

    You could use something like "  dateString (datefield0-9)  "

    Demo - http://form.jotform.us/form/52713738900153?   [CLONE IT!]

  • Profile Image
    KadeJM
    Answered on September 29, 2015 at 03:16 PM

    I apologize, I meant to include this screenshot to show you the returned day name as well.

     

    Result:

  • Profile Image
    beatsahead
    Answered on September 29, 2015 at 04:03 PM

    Thanks for your response, I had seen that formula, but just need the day from the date,

    and then 3 different calculation for different days of week, but think I've found a way to do it with conditions.

    I get the date field then equal to day. Working on it now.

  • Profile Image
    grade4pagasa
    Answered on September 29, 2015 at 04:20 PM

    hi beatsahead.

    i experimented based on the conditions / rules you gave (also piggybacked on KadeJM's solution). 

    Low = Mon - Thu.
    Mid = Fri & Sun
    High = Saturdays & all of December.

    hope i got it right. here's the sample form.

  • Profile Image
    KadeJM
    Answered on September 29, 2015 at 04:23 PM

    Yeah you'd need to create some conditional logic from this to then display the actual day of the week for each.

    I've fixed it in an update on the form I provided you with above and then have hidden the second date field. You

     

    Updated Demo: http://form.jotform.us/form/52713738900153 

     

    Additionally, you could combine it with the updated example to for your Low-Medium-High price per grade4pagas's added solution.

     

    Result:

     

    Conditions:

     

  • Profile Image
    beatsahead
    Answered on September 29, 2015 at 04:49 PM

    They both look great, but not sure what I need to do to replicate, I have low mid high for the days of week, but unable to see how to set December as high?

  • Profile Image
    beatsahead
    Answered on September 29, 2015 at 05:22 PM

    Got it

  • Profile Image
    beatsahead
    Answered on September 29, 2015 at 05:27 PM

    Thought I had, but when I create Saturday condition for high I lose December

  • Profile Image
    grade4pagasa
    Answered on September 29, 2015 at 06:12 PM

    hi beatsahead.

    this is how i did it (the JotForm support team may have an alternative solution):

    i just added December on the existing condition for Saturday.

    this way, if the field that has the date output contains the values "Sat" or "Dec", it will always show "High".

  • Profile Image
    beatsahead
    Answered on September 29, 2015 at 06:41 PM

    Your [datestring] looks like a much neater solution than mine, but I do have it working, I had to put December in before the mid and low dates or they took priority.

    http://www.jotformpro.com/form/52715048682964

  • Profile Image
    Chriistian
    Answered on September 30, 2015 at 02:54 AM

    Glad to hear that you have solved it already. If you have any further questions, feel free to contact us again.

    Regards.