Date picker gives number instead of date

  • Dtbzz
    Asked on June 24, 2019 at 3:44 AM

    Hi.

    In my form (https://form.jotformeu.com/91681752067362) I prepopulate 4 date pickers:

    1/"datum vandaag" (=today)

    2/"vandaag + 14 dagen" (=today + 14 days), using the formula "datum vandaag" + 14

    3/"+ 27d" (=today + 27 days), using the formula "datum vandaag" + 27

    3/"+ 28d" (=today + 28 days), using the formula "datum vandaag" + 28


    This works without any problems.

    I need these datepickers to be able to refer to certain dates in my form.

    E.g.:

    respond before "vandaag + 14 dagen"

    You can book from "vandaag + 28d" onwards.


    The last examples shows one of the requirements for the booking: the first date a user can pick, should be at least 28 days in the future.

    However, my users will use the form to book workshops with a release date that is many days further in the future than those 28 days:


    release date "escape" -  30th Sept 2019 

    release date "MobileDNA" - 18th Nov 2019

    release date "PDD" and "Edubox" - 20th Jan 202


    Therefore, when "today" is more than 28 days in advance of the 'release date' of the chosen workshop, I prepopulate my date pickers with the specific release date instead of "today + 27 or +28" (using the number of days between 1/1/1970 and the needed date) as the workshops are not available yet at the date given by "today + 28". I did this using conditions:

    - if field "gekozen workshop" = escape
    and date picker "datum vandaag" (=today) is before 2nd of sept (28 days in advance of release date, 30th of sept)
    then
    date picker "+ 27d" = 18168 (= 29th of sept 2019)
    and then
    date picker "+ 28d" = 18169 (= 30th of sept 2019)

    - if "gekozen workshop" = MobileDNA
    and date picker "datum vandaag" (=today) is before 21st of Oct
    then
    date picker "+ 27d" = 18225 (= 17th of Nov)
    and then
    date picker "+ 28d" = 18266 (18th of Nov)

    etc.


    I now want to show my user the messages

    - "the first date you can book is date picker +28" (in calculation field input997)

    - "You can book this workshop from date picker +28 onwards...." (in calculation field input1010).


    These fields now show the number I prepopulated the date pickers with (18169, 18225,...) instead of the date.

    Is there a way to show the dates instead of the numbers?


    Thank you for your assistance!

  • Nik_C
    Replied on June 24, 2019 at 6:28 AM

    Could you please advise where in your form are you showing such calculation (where number is showing instead of date)? 

    So we can test this issue and check further.

    You can post a screenshot as well: https://www.jotform.com/help/438-How-to-Post-Screenshots-to-Our-Support-Forum

    We'll wait for your response.

    Thank you!

  • Dtbzz
    Replied on June 24, 2019 at 6:40 AM

    1561372788Screenshot 2019 06 24 at 12 Screenshot 10



    1561372802Screenshot 2019 06 24 at 12 Screenshot 21

  • Richie JotForm Support
    Replied on June 24, 2019 at 10:08 AM

    You can try using the Form Calculation widget to convert the number into date using the Math function date().

    Date picker gives number instead of date Image 1 Screenshot 20

    Guide:https://www.jotform.com/help/259-How-to-Perform-Form-Calculation-Using-a-Widget

    Please give it a try and let us know if the issue still remains.

  • Dtbzz
    Replied on June 24, 2019 at 10:46 AM

    Issue remains...

    First red text (text field with field label): no content displayed.

    Second red text (form calculation field): still number (18169) that gets displayed, even with the date(18169) function in the calculator...


    1561387542Screenshot 2019 06 24 at 16 Screenshot 10

  • Richie JotForm Support
    Replied on June 24, 2019 at 11:59 AM

    I have tried to check your calculation but I can't seem to follow your form flow.

    Can you please share to us the flow of your form?

    Can you please also share to us the field that you had the calculation to show the numbers?


    We will wait for your response.

  • Dtbzz
    Replied on June 24, 2019 at 2:43 PM

    Apparently the date picker field within the text field disappears from the moment the text field is conditionally shown.

    If I don't "condition" the field, the date shows, if I condition it to only show up when date picker 1 is before date picker +28, the content of the date picker field +28 is gone when the field is visible.

  • Richie JotForm Support
    Replied on June 24, 2019 at 4:05 PM

    You may place your calculations in the Form calculation widget

    Date picker gives number instead of date Image 1 Screenshot 20

    and show/hide the field.

    Guide:https://www.jotform.com/help/259-How-to-Perform-Form-Calculation-Using-a-Widget

    Please give it a try and let us know if the issue still remains.

  • Dtbzz
    Replied on June 25, 2019 at 3:29 AM

    The calculation field is conditionally filled. If I put my calculations in the field itself, I cannot include these conditions.

  • Dtbzz
    Replied on June 25, 2019 at 3:31 AM

    FYI: the date() function does NOT do the trick (on the contrary, I had to remove it again from all my calculation fields). Looking at the discription, this makes sense:

    date(): Returns the sequential serial number that represents a particular date.


    I need a function that works the other way round... 


  • Dtbzz
    Replied on June 25, 2019 at 3:33 AM

    Is it possible to change the language of the datestring() function? If so, this function might help me out.

  • Nik_C
    Replied on June 25, 2019 at 4:17 AM

    I'm sorry if I misunderstood the issue, I have your form cloned and fields related moved up: https://form.jotform.com/91752462569972

    The date is showing properly:

    15614505412019 06 25 10 14 50 Screenshot 10

    I'm not able to replicate the problem with +28d field, it's calculating properly and showing properly in Text fields.


  • Dtbzz
    Replied on June 25, 2019 at 6:55 AM

    Hi Nik,

     

    I have just checked your example and found 2 differences:

    1/ You have to select the date in the +28 date picker field yourself. This way it of course gets filled with a specific date and shows up correctly. However, in my form, the +28 date picker gets filled by a NUMBER (= the serial date number) to ensure a specific date is shown. Thats why I get the number when referring to this field when conditionally filling other fields.

    2/The shown fields in your example are text fields that are conditionally shown/hidden. The issue is not in these fields (there the date shows up ok), but in the conditionally calculated fields. I tried conditionally filling a text input box and a form calculation widget, but both give me the number instead of the date.

     

    1561460063Screenshot 2019 06 25 at 12 Screenshot 10

    1561460105Screenshot 2019 06 25 at 12 Screenshot 21

     

    Thanks for thinking along to solve this problem!

  • jherwin
    Replied on June 25, 2019 at 8:11 AM

    Hello @Dtbzz - It will help us provide you with the appropriate workaround/suggestions if you can elaborate further on what you wanted to do using the form.

    Could you please let us know the issue and what should be the value if you choose a specific option in the field associated with the conditional logic? Maybe we can solve this issue if we take it one by one. Let's focus on one problem and then move to the next issue once the first problem is solved.