Change Year Date Format from YYYY to YY

  • aweyers
    Asked on July 24, 2024 at 3:48 PM
    The BONUS question is to ask whether there is a way to format the dates with only a YY at the end, instead of the YYYY format?
  • Angelica JotForm Support
    Replied on July 24, 2024 at 3:54 PM

    Hi Anton,

    I already reached out to the relevant team regarding this. We’ll get back to you as soon as we have an update.

    Thanks for your patience, we appreciate it.

  • Angelica JotForm Support
    Replied on July 25, 2024 at 2:56 PM

    Hi Anton,

    After investigating, it's not possible to directly set up the dates with only YY at the end using the Formula: addDays(Date, Days to add). But here's a workaround:

    • In Form Builder, select Widgets tab.
    • Add or drag Three Substring widgets in your form.
    • Then, go to Basic tab, scroll down and add Short Text Element.
    • Select the Three Substring widgets and the Short Text Element to Hide. Change Year Date Format from YYYY to YY Image 1 Screenshot 90
    • Next, select the Date Picker element and click the Gear icon.
    • Select Advanced tab, scroll down and click the Arrow Down icon in Field Details.
    • Copy the Field IDs value.
    • Paste the Field IDs value to the Source field ID in the Substring widgets. Change Year Date Format from YYYY to YY Image 2 Screenshot 101
    • Set up the Substring start and Substring end like you see below: Change Year Date Format from YYYY to YY Image 3 Screenshot 112 Change Year Date Format from YYYY to YY Image 4 Screenshot 123 Change Year Date Format from YYYY to YY Image 5 Screenshot 134
    • Then, in the orange navigation bar at the top of the screen, click on Settings.
    • Click on Conditions on the left side of the screen.
    • Click on Add Condition and select Update/Calculate Field. Change Year Date Format from YYYY to YY Image 6 Screenshot 145
    • You need to set up multiple conditions on each Substring Widget and Short Text Element just like the screencast below: Change Year Date Format from YYYY to YY Image 7 Screenshot 156

    Here's the result:

    Change Year Date Format from YYYY to YY Image 8 Screenshot 167

    You can check and test my demo form for your reference. Also, please note that you need to add 3 Substring widgets and Short Text element for rest of the days.

    Give it a try and let us know how it goes.

  • Angelica JotForm Support
    Replied on July 25, 2024 at 3:55 PM

    Hi Anton,

    Instead of adding Three Substring Widgets for the rest of the days. You can just add or duplicate the existing Short Text Element. Let me show you how:

    • In Form Builder, select the Short Text element.
    • Right click your mouse and click on Duplicate. Change Year Date Format from YYYY to YY Image 1 Screenshot 40
    • Next, select the existing field and click on the Conditions icon above the Gear icon.
    • Hover your mouse over the existing conditions and click the Gear icon.
    • Select clone, and update the fields accordingly. Change Year Date Format from YYYY to YY Image 2 Screenshot 51

    Here's the result:

    Change Year Date Format from YYYY to YY Image 3 Screenshot 62

    You can also check my demo form for your reference.

    Give it a try and let us know how it goes.