Skip to content

mah666hhh/ask_year_month

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 

AskYearMonth

レシーバが何月なのか、

月名からスマートに確認できるようになります。

Date, DateTime, Time, ActiveSupport::TimeWithZoneクラスを拡張しています。


You can simply check what month, what year it is by the name of the month and year.
(Year is not implemented. coming soon...)

This Gem was extend [Date, DateTime, Time, ActiveSupport::TimeWithZone].

example

# Not beautiful...
DateTime.parse('2020-12-05').month == 12
#=> true

Time.parse('2020-03-05').month == 3
#=> true

# It's beautiful!
DateTime.parse('2020-12-05').december?
#=> true

Time.parse('2020-03-05').march?
#=> true

Methods

https://github.com/mah666hhh/ask_year_month/blob/main/lib/ask_year_month/month_name_helper.rb

Usage

How to use my plugin.

Installation

Add this line to your application's Gemfile:

gem 'ask_year_month'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ask_year_month

Contributing

Contribution directions go here.

License

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

About

You can use this gem to get the name of the month.

Resources

License

Stars

Watchers

Forks

Packages

No packages published