mikeric/rivets — pull request #34 by mikeric (2012-07-21 23:42:24+00:00)
Title: Formatter arguments

Adds support for passing arguments to formatters. This is done with simple language parsing for now (alphanumerically separated values). I'd like to eventually change this to be whitespace separated.

Extra arguments just need to be added after `value` to the formatter function:

rivets.config.formatters.date = (value, format) ->
if format is "iso8601"
moment(value).format "YYYY-MM-DD"
else
moment(value).format "MMM Do, YYYY LT"