1

I'm using Drupal 8.4 Webform Module. I selected the Date element (not Date/time). In the Webform Date Settings, I'm using date picker, Medium date - D, m/d/Y (Mon, 11/27/17). (I also tried Custom, D, M j, Y.

I'm using this field in a View, Format = Default medium date and this is what I get, Thu, 12/14/2017 - 00:009:00 AMFri, 12/15/2017 - 00:005:00 PM . How do I remove the trailing zeros?

1 Answer 1

0

Go to 'yoursite/admin/config/regional/date-time' and click the button, '+ Add Format' to add a new date format.

Enter a name for this new format and add your date format in the Format string box.

Example: D, M j, Y will output Fri, Dec 22, 2017. Click Add Format

Go to your Webform > build and select the date element you want format with your new date format. In the Advanced tab, select your new date format in the SUBMISSION DISPLAY > SINGLE ITEM > ITEM FORMAT box and save.

You should also be able to select the new date format in Views.

Its best to clear the cache at yoursite/admin/config/development/performance

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.