The Moment.js JavaScript library ready to play with the Rails Asset Pipeline
Pull request Compare This branch is 39 commits behind derekprior:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
vendor/assets/javascripts
.gitignore
MIT-LICENSE
README.md
Rakefile
changelog.md
momentjs-rails.gemspec

README.md

momentjs-rails

momentjs-rails wraps the Moment.js library in a rails engine for simple use with the asset pipeline provided by rails 3.1. The gem includes the development (non-minified) source for ease of exploration. The asset pipeline will minify in production.

Moment.js is "a lightweight javascript date library for parsing, manipulating, and formatting dates." Moment.js does not modify the native Date object. Rather, it creates a warpper for it. Please see the documentation for details.

Usage

Add the following to your gemfile:

gem 'momentjs-rails'

Add the following directive to your Javascript manifest file (application.js):

//= require moment

If you want to include a localization file, also add the following directive:

//= require moment/<locale>.js

Versioning

momentjs-rails 1.6.2 == Moment.js 1.6.2

Every attempt is made to mirror the currently shipping Momentum.js version number wherever possible. The major, minor, and patch version numbers will always represent the Momentum.js version. Should a gem bug be discovered, a 4th version identifier will be added and incremented.