Skip to content

mah666hhh/ask_year_month

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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