on a Drupal 8 webform, I have a datetime entry which works fine and I can format it in settings. When I create a custom composite with a datetime in it, I don't have the same formatting options as before. For example, I cannot pick a display or submit format for the date.

I could create a module to hook onto the submission and alter it that way or, presumably, I could do this in the email submission with tokens. (I have not tried that yet.) That would only affect the submission and not the display, though.

How do I format the display and submission format of a datetime field in a custom composite?

1 Answer 1


For defining the format of the DateTime field you can use CUSTOM COMPOSITE SETTINGS.

Example: To set the format to datepicker like a normal date field, set datepicker: true inside the custom text field for the respective composite DateTime element. All other properties can be added here.

You can checkout the JSON representation of the respective property from the source option of the webform. Copy-pasting the properties inside the custom composite setting is all needed.

To set the submission format:

Go to Advance option of the composite element > Under submission display fieldset select the way you want to display the items.

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.