date_misc 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3378aa0d761383c6b3ae35c44a419d4d76760aa2
4
- data.tar.gz: afa4a04894d11e50a6456187390c3ec37fa2e41a
3
+ metadata.gz: 14d361b15167c4e3a6a9515174579bb1fc7b85f4
4
+ data.tar.gz: c9b0249cdcb238d2dfe4bda0a55baf13d8043c68
5
5
  SHA512:
6
- metadata.gz: f79a390ce334eca53d1cdc3fef23c794e355e1c6fb603e117ce5f113cbce09b135328148a3b196370e33bb747a0a05e20bd1ee29825aa7b504d7f97d11b1d2b5
7
- data.tar.gz: 48636567ad15958081eebcc8ba2f116438f6faf13f7e0e35da26343dd71e46005f5484f55ed2f0b4c4e444886a213f8fd54cc0d577b5bdf4f82c1bba29fc3396
6
+ metadata.gz: 841528247085405186de874f520de25e33883851f9da5ff007fb3bc06f8e73d35c414892467afabdeaa3357b208656723cbef5635d88a892306db1c600a61b6b
7
+ data.tar.gz: 2e53d7359f18a513c0a1d901a8844d6382b1a654d73bcd3a503fba99e61bb7a10c012fd00580bf38877c6078f0190b28d15365789abf45eb3f78a7d9981d2a16
data/lib/date_misc.rb CHANGED
@@ -1,8 +1,10 @@
1
1
  require 'date_misc/version'
2
2
  require 'date_misc/easy_parse'
3
+ require 'date_misc/localized_names'
3
4
  require 'date_misc/wday_position'
4
5
 
5
6
  class Date
6
7
  extend ::DateMisc::EasyParse
8
+ include ::DateMisc::LocalizedNames
7
9
  include ::DateMisc::WdayPosition
8
10
  end
@@ -0,0 +1,19 @@
1
+ module DateMisc
2
+ module LocalizedNames
3
+ WDAY_NAMES = {
4
+ ja: %w[日 月 火 水 木 金 土 日],
5
+ }.freeze
6
+
7
+ MONTH_NAMES = {
8
+ ja: %w[睦月 如月 弥生 卯月 皐月 水無月 文月 葉月 長月 神無月 霜月 師走]
9
+ }.freeze
10
+
11
+ def wday_name(lang = :ja)
12
+ WDAY_NAMES[lang][self.wday]
13
+ end
14
+
15
+ def month_name(lang = :ja)
16
+ MONTH_NAMES[lang][self.month - 1]
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module DateMisc
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: date_misc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SHIOYA, Hiromu
@@ -83,6 +83,7 @@ files:
83
83
  - date_misc.gemspec
84
84
  - lib/date_misc.rb
85
85
  - lib/date_misc/easy_parse.rb
86
+ - lib/date_misc/localized_names.rb
86
87
  - lib/date_misc/version.rb
87
88
  - lib/date_misc/wday_position.rb
88
89
  homepage: https://github.com/kwappa/date_misc