Project

jisa

0.0
No commit activity in last 3 years
No release in over 3 years
It returns japanese string with the difference in terms of year, month, week, day, hour, minute and second.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.16
~> 10.0
~> 3.0
 Project Readme

Jisa

Time difference in Japanese.
It returns japanese string with the difference in terms of year, month, week, day, hour, minute and second.

Installation

Add this line to your application's Gemfile:

gem 'jisa'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jisa

Usage

Jisa.in_japanese(Time.now - 1)
# => "1秒前"

Jisa.in_japanese(Time.now - 60)
# => "1分前"

Jisa.in_japanese(Time.now - 60 * 60)
# => "1時間前"

Jisa.in_japanese(Time.now - 60 * 60 * 24)
# => "1日前"
 
Jisa.in_japanese(Time.now - 60 * 60 * 24 * 7)
# => "1週間前"
 
Jisa.in_japanese(Time.now - 60 * 60 * 24 * 7 * 4)
# => "1ヶ月前"
  
Jisa.in_japanese(Time.now - 60 * 60 * 24 * 7 * 4 * 12)
# => "1年以上前"

Contributing

  1. Fork it ( https://github.com/nishide-h/jisa/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

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