21. Mai 2012

“Prettify” your Grails app

There are two nice small plug-ins for Grails that make your webapp a little prettier: Pretty Size and Pretty Time. The first one, Pretty Size, does this:

<prettysize:display size="${someSize}" />

generates outputs like:

"one kilobyte", "2 megabytes", or "3 GB"

The second one, Pretty Time, does this:

<prettytime:display date="${someDate}" />

generates timestamps like:

"right now", "2 days ago", or "3 months from now"

For i18n, check the “message.properties” file from the plugin directory.

Thanks to the creative developers in the Grails community! Have fun!

Diese Beiträge könnten Sie noch interessieren:

Ihre Meinung ist uns wichtig

*