radiant/radiant — Issue #322: Multiple Radius tags for rendering dates is redundant
Author: SamWhited
Created: 2012-02-28 21:02:24+00:00
State: open
Labels: annoyance, API

Radiant defines two Radius tags for rendering dates, `` for outputting generic dates using Ruby's `strftime` and `` which always outputs RFC-1123 formatted dates.

r:date has two attributes, `format`, and `for`. The for attribute allows the user to select between the current datetime, the datetime when the page was published, or the datetime when the page was last updated.

r:rfc1123 however, has no such functionality. Which means if the user wants to get the current datetime in RFC-1123 format, they must use the r:date tag, and write a format string for RFC-1123.

The functionality of these two tags either feels either incomplete, or redundant.

I see two possible fixes for this.

1. Allow the r:date tag to accept the string "rfc1123" for the format attribute, and eventually deprecate the r:rfc1123 tag.
2. Add a `for` attribute to the r:rfc1123 tag that behaves like the one in r:date.

The problem with the first solution, is that it (sortof) breaks the point of the format string (or at least makes the code a little less elegant). While I can't imagine this really being a problem, it just feels a wrong.

The second solution still requires multiple tags, however, it makes the r:rfc1123 tag much more useful (especially for RSS feeds with often contain `` and `` tags).

Implementing both solutions (I feel) is just redundant, however, for the purposes of illustration, I threw together a quick patch that does both: [https://gist.github.com/1935006](https://gist.github.com/1935006)

Do people thing one or the other solution would be better, or am I creating a problem where one doesn't exist?
I didn't make this issue a pull request, because I definitely think only one of these changes needs to be implemented. I'll actually stick (part of) the patch in my repo and merge it if there's a general consensus that one or the other should be implemented.