Smart Date - Time to Level Up!

A Drupal Drop and an Echidna emulating the Look Who's Talking Too poster.

Just over a month ago, I shared with you some information on a new Drupal module that we’ve been developing called Smart Date. Today, I’m  excited to announce the stable release of Smart Date is official -- and its ongoing development and improvement shows the power and value of the open-source community. 

We’re excited about the future of this module as there’s already been a lot of discussion with the Drupal community about how this module can add value, and especially how it can add value within the broader ecosystem.

Delivering On the Promise

This release delivers on a couple of features that were planned as part of the original concept for Smart Date. First, it now allows each of the allowed durations configured for a field to have a custom label. For example, instead of showing “60 minutes”, you can change it to “1 hour,” if that makes a better experience for your site editors. We implemented this following the approach Drupal core uses for list fields, so it should feel familiar to site builders.

We also understood from early on that the preferred formatting for dates and time varies widely by region and language, so we wanted to make sure that the granular control Smart Date provides for formatting could also made language-specific. Those settings are now managed in fully translatable configuration entities. It  even installs a small set of default formats that can be customized, but you’re free to make your own.

The significant work to get this implemented was largely completed as part of the code sprints at the Drupal North regional summit in Montreal, so we’re grateful to the organizers for the support (and snacks) in helping us make this important change a reality.

Since we last wrote here about Smart Date, it has also gained rewritten support for Views, and its own user guide in the documentation on drupal.org.

Made Better by Community

Some significant new features now exist thanks to the Drupal community and its enthusiastic reception for Smart Date.

While it initially offered an option to reduce duplication of the am/pm display in time ranges, thanks to feedback from people using it in real-world applications, we made a change so it will now also reduce duplication of timezone display and attempt to create a more natural output for date-only ranges.

There’s also now support for handling zero-duration events. In fact, if you define that as one of the predefined duration increments then, when it’s selected, the end date and time fields disappear, again to make it feel like a purpose-built calendar application.

Speaking of calendars, clients and site owners often want their events displayed in a calendar. After some feedback that Fullcalendar View was a good choice to work with, we were able to find a fix for Smart Date to display properly in Fullcalendar View displays.

We also heard from the community that they wanted more control over the markup of  the formatted dates and times. We definitely can’t anticipate every use case, so instead of a simple string the output is now a Drupal-standard render array, giving each site the power to fully customize the output in a custom module or theme.

Finally, we got a request to offer enhanced support Tokens. Given the incredible flexibility these provide (for example, to populate metatags,) this was definitely worth the effort to implement. When using tokens you can now leverage one of the aforementioned, predefined formats, or even provide a custom PHP date string format directly within the token.

The Road Ahead

Of the requests we’ve received, one stands out as being the most coveted: recurring dates. The existing Recurring Dates Field module does a solid job with recurring dates, but it doesn’t currently offer handling of all day events and setting up views with it requires extra steps. We’ve already started work on the 8.x-2.x branch of Smart Date specifically to provide recurring dates, so site builders will have single, simple solution for a variety of functional needs when managing dates and times.

As I mentioned in my previous post, we want to develop functionality that works for end-users -- whether they’re inputting or consuming content. And supporting -- and being supported by -- an open-source community allows us to maximize our impact by having people contribute new ideas, improvements, and use cases that allow our impact to extend well beyond our “reach.” If you’re a developer who has the opportunity to use Smart Date, we’d love to hear from you! 

-- 

Did you enjoy this article? Get more just like it by signing up to receive Digital Echidna’s free e-newsletter, delivered to your inbox every month. Subscribe today.


 

Categories

SUBSCRIBE TO OUR E-NEWSLETTER

CONNECT WITH US

Twitter Facebook Linkedin RSS