carakan / facebook_distance_of_time_in_words Goto Github PK
View Code? Open in Web Editor NEWThis project forked from acmetech/facebook_distance_of_time_in_words
A simple ruby on rails helper to display time distance just like Facebook
This project forked from acmetech/facebook_distance_of_time_in_words
A simple ruby on rails helper to display time distance just like Facebook
= facebook_distance_of_time_in_words facebook_distance_of_time_in_words helps you to display time distance just like Facebook does == Install `script/plugin install git://github.com/cedricbousmanne/facebook_distance_of_time_in_words.git` == Usage In your view: <%= facebook_distance_of_time_in_words(@object.created_at) %> == Examples <% dates = [ Time.now-1.minute, Time.now-5.minutes, Time.now-33.minutes, Time.now-1.hour, Time.now-1.4.hours, Time.now-1.6.hours, Time.now-3.hours, Time.now-23.hours, Time.now-1.day, Time.now-1.day-12.hours, Time.now-2.days, Time.now-3.days, Time.now-4.days, Time.now-5.days, Time.now-6.days, Time.now-7.days, Time.now-1.month, Time.now-1.year, ] %> <% for date in dates -%> <%= facebook_distance_of_time_in_words(date) %><br /> <% end -%> === Produces #: Now = Wednesday, 7:35 PM today at 7:34pm<br /> today at 7:30pm<br /> today at 7:02pm<br /> about one hour ago<br /> about one hour ago<br /> about 2 hours ago<br /> about 3 hours ago<br /> yesterday at 8:35pm<br /> yesterday at 7:35pm<br /> yesterday at 7:35am<br /> Mon at 7:35pm<br /> Sun at 7:35pm<br /> Sat at 7:35pm<br /> Fri at 7:35pm<br /> Thu at 7:35pm<br /> 7 days ago<br /> January 11 at 7:35pm<br /> February 11, 2009<br /> == Localization facebook_distance_of_time_in_words uses i18n to display time distance. For now, only french and english are available. If you're able to translate the localization files into others languages, feel free to contact me and i'll add your contribution to the project. == Contact This plugin has been written by Cédric Bousmanne. You can find contact information on my personnal page : http://cedricbousmanne.com/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.