week_of_month 1.0.1 → 1.0.3
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.
- data/lib/week_of_month.rb +25 -22
- metadata +2 -2
data/lib/week_of_month.rb
CHANGED
@@ -1,23 +1,26 @@
|
|
1
|
+
#!/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
|
1
4
|
require 'active_support'
|
2
5
|
require 'active_support/core_ext/date/calculations.rb'
|
3
6
|
|
4
7
|
class Date
|
5
8
|
|
6
|
-
WEEK_IN_ENG = {1 =>
|
7
|
-
|
8
|
-
|
9
|
+
WEEK_IN_ENG = { 1 => 'First', 2 => 'Second',
|
10
|
+
3 => 'Third', 4 => 'Fourth',
|
11
|
+
5 => 'Fifth', 6 => 'Sixth' }
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
WEEK_IN_FR = { 1 => 'First', 2 => 'Second',
|
14
|
+
3 => 'Third', 4 => 'Quatrième',
|
15
|
+
5 => 'Cinquième', 6 => 'sixième'}
|
16
|
+
|
17
|
+
WEEK_IN_GER = { 1 => 'First', 2 => 'Second',
|
18
|
+
3 => 'Dritten', 4 => 'Vierte',
|
19
|
+
5 => 'Fünfte', 6 => 'Sechste'}
|
17
20
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
WEEK_IN_JAP = { 1=>'最初', 2 =>'秒',
|
22
|
+
3 =>'サード', 4=> '第4回',
|
23
|
+
5 =>'第五',6=> 'シックス' }
|
21
24
|
|
22
25
|
def days_array
|
23
26
|
day = self.beginning_of_month.wday
|
@@ -57,16 +60,16 @@ class Date
|
|
57
60
|
WEEK_IN_ENG[week_of_month]
|
58
61
|
end
|
59
62
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
+
def week_of_month_in_fr
|
64
|
+
WEEK_IN_FR[week_of_month]
|
65
|
+
end
|
63
66
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
+
def week_of_month_in_ger
|
68
|
+
WEEK_IN_GER[week_of_month]
|
69
|
+
end
|
67
70
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
+
def week_of_month_in_jap
|
72
|
+
WEEK_IN_JAP[week_of_month]
|
73
|
+
end
|
71
74
|
|
72
75
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: week_of_month
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|