Dates: Format to ddMMMyy

  • thinkingjuice
    Asked on January 29, 2018 at 7:44 AM

    I've gone through various date related threads with calculations and widges but can't work out how to achieve this...

    need the output from a date field (ideally from a date picker) to be ddMMMyy (i.e. like 29jan18)

    The final output is required for a calculated field which is combining the text from multiple fields (it's actually producing an analytics URL with various fields added to the end of the URL)

  • aubreybourke
    Replied on January 29, 2018 at 11:01 AM

    What you are looking for is called a date string.

    1) Add a date picker field

    2) Add a form calculation widget

    3) Open the wizard for the form calculation widget (magic wand icon)

    4) Click on the three dots button and scroll down to the bottom. You will see the dateString function 

    5) Add your date picker field as a parameter to the dateString function.

    6) Hit the green save button

    For example:

    1517241497The Easiest Online Form Builde Screenshot 10

    It will look like this:

    1517241578The Easiest Online Form Builde Screenshot 21

    Demo is here:

    https://form.jotform.com/80283927236966


  • thinkingjuice
    Replied on January 29, 2018 at 11:07 AM

    Thanks very much for the assistance.

    And from the string field, is there a way to mod that output to remove spaces, e.g. to end up with the output "29jan18"?

  • aubreybourke
    Replied on January 29, 2018 at 11:54 AM

    OK, you mean like this:

    1517244589The Easiest Online Form Builde Screenshot 10

    https://form.jotform.com/80283927236966

    I used three substring widgets to extract the day, month, and year into separate fields.

    For example "month" looks like this:

    1517244782The Easiest Online Form Builde Screenshot 21

    Then I added a short text field. And appended each separate field together.

    Condition looks like this:

    1517244858The Easiest Online Form Builde Screenshot 32

     

  • thinkingjuice
    Replied on January 29, 2018 at 12:15 PM

    Thank you, that's excellent!

    Final question - is there a function/widget to put the entry into lower case?

  • aubreybourke
    Replied on January 29, 2018 at 12:28 PM

    Thank you, that's excellent!

    Welcome, happy you like it.

    Final question - is there a function/widget to put the entry into lower case?

    You can use CSS to transform the text to lowercase. 

    First get the field ID from the properties (gear icon) on the advanced tab.

    For example:

    1517246661The Easiest Online Form Builde Screenshot 10

    The CSS looks like this:

    #input_5, #input_8 {

      text-transform: lowercase !important;


    }

    How-to-Inject-Custom-CSS-Codes 


    I updated the demo. Its working here:

    https://form.jotform.com/80283927236966