When building event listings in Drupal 10 or 11, getting the date display just right can make a huge difference in readability and user experience. The default Views output for date or daterange fields can sometimes be clunky or repetitive—especially for events that start and end on the same day.
Out of the box, you have three options:-
Display start date,
Display end date, or
Display both start and end date.
In this guide, I’ll walk you through how to override the output of a date field in a View using custom Twig code—a clean, theme-friendly way to format start and end dates without writing a custom module or modifying templates.
This helps verify the correct field names before adding date formatting logic.
Why This Works
Drupal Views gives you powerful control over field output via Twig. By using the |date('U') filter and format_date(), you can safely and flexibly format date values—even compare start and end values to conditionally simplify output.
This method:
Requires no custom modules
Keeps your logic self-contained in the UI and View config
Produces clean, semantic HTML
Final Thoughts
This Twig-based approach is perfect for site builders and themers who want better control over event displays—no PHP required. It’s flexible, readable, and native to Drupal.
Have a variation you use, or want to build on this with i18n support or schema markup? I’d love to hear about it—drop a comment or get in touch!