Plugin details

EZTime is a simple extension to the Date class in Ruby to provide easy formatting of dates and times.

Websitehttp://users.webtest.wvu.edu/cbscharf/eztime/ Repositoryhttp://svn.webtest.wvu.edu/repos/rails/plugins/eztime/ Author Chris Scharf Tags Date, Time LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://svn.webtest.wvu.edu/repos/rails/plugins/eztime/

Simplicity
============
EZTime is much easier to use than strftime because it doesn’t require much memorization. For example, isn’t ":month/:day/:year" easier than "%m/%d/%Y"? Not convinced? How about ":day:ordinal of :month_name, :year" (i.e. 20th of December, 2003).

Extensibility
=============
Perhaps the strongest feature of EZTime is that it can be "extended" by simply adding new methods to the EZTime module. The reason this works is because EZTime eval’s the formatting string after a simple substitution, replacing the :name with a method call to that name. The upside to this is that everything you put in the formatting string can be accessed by itself as a method call.

Formatting variants
================
Certain methods have one or more variants, all following a standard convention:

    * ‘z’: (prefix) element will include a leading 0 digit
    * ‘l’: (prefix) (lowercase L): element will be converted to all lowercase
    * ’s’: (prefix) small variants. For example, smeridian will return ‘A’ or ‘P’
    * ‘12’: (suffix): element will be in 12-hour format


See the documentation for the various methods for examples of these modifiers.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 7 months ago