Changing format of calculated date?

  • Profile Image
    tmi
    Asked on November 23, 2015 at 12:52 AM

    Hi Support,

    Can we format the calculated date.. i.e like dd-mmm-yy

    now, the output is showing day mmm dd yyyy format.

    we are trying to send the notification to some other system with due date in the subject. The other system is allowing to set due date in dd-mmm-yyyy format only.

    please advise.

    Regards,

    Krishna

  • Profile Image
    Charlie
    Answered on November 23, 2015 at 01:05 AM

    This should be possible by using conditional logic to calculate the date.

    Here's an example:

    1. First, add two datetime fields, have them all in dd-mm-yyyy format. We will then use conditional logic to calculate the date.

    2. In the "Conditions" wizard, choose "Update a form field value"

     

    3. Here, I say that when the "Date" field is filled out, fetch it's value and add 7 days on it. Output the value on another datetime field, in this case, it's named as "Date Calculated".

     

    4. You should then receive the date on the date format that you like.

    I hope that helps.

  • Profile Image
    tmi
    Answered on November 23, 2015 at 05:42 AM

    Hi Support,

    Thank you for your reply.

    Please advise how to bring the date in <date dd mmm> format i.e like <date 19 nov>.

    The date should be in subject line of the email which we are generating as notification from jotform.

    kindly advise.

     

    Regards,

    Krishna

     

     

  • Profile Image
    Charlie
    Answered on November 23, 2015 at 08:39 AM

    You will then need to have a separate field, which is the form calculation widget to convert the date into a datestring.

    1. First, use the form calculation widget.

    2. Use the dateString function and convert the "Date Calculated" field.

     

    3. However, the format is fixed like this:

    Mon Nov 30 2015

     

     

     

    In your email notification, you can add the "Calculation" value in the subject line.

     

     

    In conclusion, you cannot change the date format if you would like it to be converted on a date string like "November 23, 2015", it has a fixed format for the dateString function.

    However, if you would like to change the date format like dd/mm/yyyy then that is possible.

    Do let us know if you still have questions on this.

  • Profile Image
    tmi
    Answered on November 23, 2015 at 11:13 AM

    Hi Charlie,

    Thank you for your reply.

    We need to convert the date into dd/mmm/yy format. ex: 23/Nov/15

    Kindly advise.

    Regards,

    Krishna

  • Profile Image
    Charlie
    Answered on November 23, 2015 at 12:38 PM

    If you would like to have a combination of numbers and text in the date format like 23/Nov/15, unfortunately, it is not possible. There's two formats that is available:

    Format 1: All numerics

    11/23/2015

     

    Format 2: date as string

    Mon Nov 23 2015

     

    This should be possible if you are familiar with Javascript, you can create a custom script that will give you that format. However, you'll need to use the form's full source code and incorporate your custom script there.

    You can also try the different date widgets here: http://widgets.jotform.com/search/date. However, I believe that they are not possible to be used in the form calculation, unlike the default DateTime field.

    I hope that gives you an idea on how to proceed.

  • Profile Image
    rothschild86
    Answered on March 12, 2016 at 03:00 PM

    I liked the first method, but it does not seem to work. The second date field remain empty.... Could you test on your end?
  • Profile Image
    jonathan
    Answered on March 12, 2016 at 04:04 PM

    @  rothschild86

    Your concernm could be due to a different issue. We will resovle it separately here 

    http://www.jotform.com/answers/793419