Module: PositiveTimeSupport::DateExt
- Defined in:
- lib/positive_time_support/date_ext.rb
Overview
日付を扱うクラス Date に機能を追加するモジュール
Constant Summary collapse
- WDAYS_JA_SHORT =
[ "日" , "月" , "火" , "水" , "木" , "金" , "土" ]
Instance Method Summary collapse
-
#holiday? ⇒ Boolean
(日本の)祝日か否かを判定するメソッド.
- #to_strf_date_ja ⇒ Object
- #wday_ja ⇒ Object (also: #wday_ja_normal)
- #wday_ja_long ⇒ Object
- #wday_ja_short ⇒ Object
Instance Method Details
#holiday? ⇒ Boolean
(日本の)祝日か否かを判定するメソッド
22 23 24 |
# File 'lib/positive_time_support/date_ext.rb', line 22 def holiday? ::HolidayJapan.check( ::Date.new( year , month , day ) ) end |
#to_strf_date_ja ⇒ Object
26 27 28 |
# File 'lib/positive_time_support/date_ext.rb', line 26 def to_strf_date_ja "#{ year }年#{ month }月#{ day }日" end |
#wday_ja ⇒ Object Also known as: wday_ja_normal
10 11 12 |
# File 'lib/positive_time_support/date_ext.rb', line 10 def wday_ja "#{ wday_ja_short }曜" end |
#wday_ja_long ⇒ Object
16 17 18 |
# File 'lib/positive_time_support/date_ext.rb', line 16 def wday_ja_long "#{ wday_ja_short }曜日" end |
#wday_ja_short ⇒ Object
6 7 8 |
# File 'lib/positive_time_support/date_ext.rb', line 6 def wday_ja_short WDAYS_JA_SHORT[ wday ] end |