- Issue created by @cedewey
- πΊπΈUnited States cedewey Denver, CO
I marked this major since Smart Date is a popular contrib module, but I could see the argument for bringing this back to the normal priority.
- πΊπΈUnited States mlncn Minneapolis, MN, USA
Note: After enabling the smart date recur module and datetime range module, there was still an error:
Fatal error: Declaration of Drupal\inotherwords\Plugin\Field\FieldFormatter\InotherwordsDateRangeFormatter::viewElements(Drupal\Core\Field\FieldItemListInterface $items, $langcode) must be compatible with Drupal\smart_date_recur\Plugin\Field\FieldFormatter\SmartDateRecurrenceFormatter::viewElements(Drupal\Core\Field\FieldItemListInterface $items, $langcode, $format = '') in /app/web/modules/contrib/inotherwords/src/Plugin/Field/FieldFormatter/InotherwordsDateRangeFormatter.php on line 181
Still, adding in commit 4ff736e in 2.0.x the requirement on both those modules, as a first step.
But we will remove this from the new 3.0.x branch, the formatter is almost entirely redundant with ones provided by Smart Date itself. As noted in the commit message removing it:
> Features like 'August 3rd through September 1st' are only capability that
> In Other Words provided that Smart Date didn't already, i think, and if we
> want that functionality it should first be a feature request at Smart Date
> and if not accepted build on Smart Date (not retrofitted like before) in a
> submodule so that the date dependencies don't end up in In Other Words. - π¨π¦Canada mandclu
I'm the maintainer of Smart Date and would be happy to help these modules work better together
- πΊπΈUnited States mlncn Minneapolis, MN, USA
Thanks @mandclu! In Other Words is about natural language formatting or condensing lists of stuff. The 2.0.x branch was a mess because it had already done a lot of date shortening, and then bolted Smart Date on top of it. That's not worth fixing!
For the 3.0.x branch, though, the question really is if there's anything In Other Words can do that couldn't just as well live in Smart Date itself. I suppose we allow prefixes and suffixes, so we could extend Smart Date's formatters with that. But that's not a super compelling use case. The only thing i know offhand that we did that i think Smart Date doesn't yet is allow the connecting word to be chosen, so it could output for example "August 3rd through September 1st".
Would you entertain a feature request for something like that, or should we make that a feature in In Other Words?
- π¨π¦Canada mandclu
Smart Date formats do have a "Time separator" property which does allow a site builder to set this connecting word. If there are additional ways Other Words would like to add to Smart Date's formatting, the Date Augmenter API β is a way to make additional capabilities available. I'd be happy to provide additional information if there's interest in providing the prefix and suffix capabilities in one or more DateAugmenter plugin classes. Here's a simple example for reference.
- π¨π¦Canada mandclu
Looking at the blog post you linked, there may also be an opportunity to leverage Other Words with recurring dates, for example when creating the text to describe on which days an event will recur.