Changed timeago_init(), now it supports arbitrary date types, checks if any of those used the defined TIMEAGO_FORMAT_* formats. See attached patch.

CommentFileSizeAuthor
timeago-support-custom-date-types.patch1.63 KBtemaruk

Comments

icecreamyou’s picture

Status: Active » Postponed (maintainer needs more info)

What is the point of this patch? It seems very unlikely that anyone would use exactly one of the Timeago formats without using one of the provided default formats since that would be duplicating them.

temaruk’s picture

It would make sense in the case of comments. Imagine several content types with commenting enabled, but only some of them (or only one) would need a different date type (using a Timeago format) for rendering the created/changed date of its comments. Well, of course, changing the date type for comments per content type is not really possible via configuration, unless another module is installed which allows this (e.g. Displays Suite, Comment Goodness).

However, if your assumption is that the Timeago formats would not be used without the default formats, then I would recommend not showing them as options for custom date types.

icecreamyou’s picture

Status: Postponed (maintainer needs more info) » Fixed

Oh, I see now -- I thought by "date type" you meant "date format."

Committed to dev - thanks!

temaruk’s picture

Cool! Hope it will be useful for others as well!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.