0.0
No commit activity in last 3 years
No release in over 3 years
A gem to integrate the timeago.js
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0

Runtime

>= 3.1
 Project Readme

TimeAgo

A gem that integrates timeago.js in to a Rails application and provides a simple way to render relative timestamps in a view.

Gem Version

Installation

Add this line to your application's Gemfile:

gem 'jquery-timeago'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jquery-timeago

Usage

Add the following to app/assets/javascripts/application.js :

//= require jquery-timeago

Tags using the timeago view helper get rendered to UI as:

<time class="timeago" datetime="2016-01-08T14:55:58Z">
    2016-01-08 14:55:58 UTC
</time>

and are updated to:

<time class="timeago" datetime="2016-01-08T15:04:10Z" title="2016-01-08 15:04:10 UTC">
    20 days ago
</time>

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/roshan92/jquery-timeago. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.