How to display the Day and Date format using Form Calculation Widget?

  • pgctreasdisbursements
    Asked on May 10, 2024 at 12:01 AM
    Availability of date format to format in "Word" not in number e.g. January 1, 2024 (can be used in writing formal letter template) or removal of day name (e.g. Monday Jan 30 2024) in the using calculation datestring and substring.
  • Mary_Ed JotForm Support
    Replied on May 10, 2024 at 4:50 AM

    Hello Pgctreasdisbursements,

    Thanks for reaching out to Jotform Support and we’re sorry you’re having trouble with this. I did some tests and it's not possible to show the day on the Date Picker field. But here's a workaround you could do:

    1. Add a Form Calculation Widget to your form and a Short Text field.

    • The Form Calculation Widget will be used to pull the day of the selected date. Hide this widget so that it is not displayed and causes confusion to your form respondents.
    • The Short Text field will be used to display the complete text for the day using conditional logic.

    How to display the Day and Date format using Form Calculation Widget? Image 1 Screenshot 90

    2. Set up the formula inside your Form Calculation Widget. Add the math function, dateString().

    How to display the Day and Date format using Form Calculation Widget? Image 2 Screenshot 101

    3. Add the Date Picker field inside the dateString() math function and click the Save button.

    How to display the Day and Date format using Form Calculation Widget? Image 3 Screenshot 112

    It converts the Date value to a date string with the first 3 letters of the day and month. Take a look at the screenshot below to see my results:

    How to display the Day and Date format using Form Calculation Widget? Image 4 Screenshot 123

    4. Add several Update/Calculate Field conditional logic to insert the full text of the day into the Short Text field we added earlier based on the calculation value of the Form Calculation Widget. You can check this guide for more details on this type of condition where you can insert a certain text into a field based on another field's value. Here's what the condition would look like:

    How to display the Day and Date format using Form Calculation Widget? Image 5 Screenshot 134

    The condition will just insert the full "Monday" text into the short text field if the Form Calculation widget contains the word/value "Mon" since the dateString() math function only includes the first 3 letters of the day. Please note that you need to add this condition for all the days of the week.

    5. Add a Substring Widget to get the Date format e.g. "Jan 29, 2024", from the Form Calculation Widget.

    How to display the Day and Date format using Form Calculation Widget? Image 6 Screenshot 145

    6. Get the Field ID of the Form Calculation Widget to pull the Date, and set up the Substring Start and End.

    How to display the Day and Date format using Form Calculation Widget? Image 7 Screenshot 156

    Check out the screencast below to see my results:

    How to display the Day and Date format using Form Calculation Widget? Image 8 Screenshot 167

    Give it a try and reach out again if you have any other questions.


 
Your Answer