fe_core_ext 0.8.3 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fe_core_ext/core_ext/date.rb +12 -0
- data/lib/fe_core_ext/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ad61cadab269ee32452f5beffbbea704da10b231c4283d6e36d50bf15b88f5b
|
4
|
+
data.tar.gz: 9a8dbf59f02483aee9579ef822a8ba959da000ce30102b25ebd8522d6d32a500
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c0559268079f39269f6b9af9c2509577abd9f18ff8d2037dc71fd30fce96576425e6a1cda15dac89ad81afdf1b5ee50ebbdda373c9044b2f4ea384a730071da
|
7
|
+
data.tar.gz: 4b3df4d8d22ea1e737d0bd93262ba555eddc28919a483641fc4c54dc931b182aa7a3fb2126c5bcd2aed15b8b6ab4a2c8633e7cd8acb7df1930667b6af7e9256c
|
@@ -29,6 +29,18 @@ module FeCoreExt::CoreExt::DateClassMethods
|
|
29
29
|
Date.new($1.to_i + 1988, $2.to_i, $3.to_i)
|
30
30
|
}
|
31
31
|
end
|
32
|
+
|
33
|
+
def parse_reiwa(string)
|
34
|
+
string.match('令和(\S+)年(\d+)月(\d+)日') {
|
35
|
+
year = 1 if $1 == '元'
|
36
|
+
year ||= $1.to_i
|
37
|
+
Date.new(year + 2018, $2.to_i, $3.to_i)
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
def parse_gengo(string)
|
42
|
+
parse_heisei(string) || parse_reiwa(string)
|
43
|
+
end
|
32
44
|
end
|
33
45
|
|
34
46
|
class Date
|
data/lib/fe_core_ext/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fe_core_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tetsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|