drexed-datetime 0.0.9 → 0.0.10
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 +4 -4
- data/app/helpers/datetime_helper.rb +69 -23
- data/lib/drexed/datetime/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a285787da3e2186407da1e31c83be9cf5f7b6f9f
|
4
|
+
data.tar.gz: 375c14df7ff35fe6c9b55b2e4f6eefa5df093224
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0102280128fbf7248144a03a5cc131937ae87f40684773dfdda68c290e609f07f65a19baf9c13342d1416d3201a0a056e9977a2a1e1f79138e27e9c577253e65
|
7
|
+
data.tar.gz: d2c37ca1dd569e1d69e6e6c52289cff34d0380dfddbf7709df0f436efb3195c42abbc2f2ade9fcbae629be74a9a3c8dbe08f4a710ad699a4cddfc89aeca5c522
|
@@ -2,161 +2,207 @@ module DatetimeHelper
|
|
2
2
|
|
3
3
|
## Ex. 2013
|
4
4
|
def year_for(tach)
|
5
|
-
|
5
|
+
if tach.blank?
|
6
|
+
"Datetime N/A"
|
7
|
+
else
|
6
8
|
tach.strftime("%Y")
|
7
9
|
end
|
8
10
|
end
|
9
11
|
|
10
12
|
## Ex. December
|
11
13
|
def month_name_for(tach)
|
12
|
-
|
14
|
+
if tach.blank?
|
15
|
+
"Datetime N/A"
|
16
|
+
else
|
13
17
|
tach.strftime("%B")
|
14
18
|
end
|
15
19
|
end
|
16
20
|
|
17
21
|
## Ex. Dec
|
18
22
|
def abbr_month_name_for(tach)
|
19
|
-
|
23
|
+
if tach.blank?
|
24
|
+
"Datetime N/A"
|
25
|
+
else
|
20
26
|
tach.strftime("%b")
|
21
27
|
end
|
22
28
|
end
|
23
29
|
|
24
30
|
## Ex. 4
|
25
31
|
def day_number_for(tach)
|
26
|
-
|
32
|
+
if tach.blank?
|
33
|
+
"Datetime N/A"
|
34
|
+
else
|
27
35
|
tach.strftime("%e")
|
28
36
|
end
|
29
37
|
end
|
30
38
|
|
31
39
|
## Ex. Wednesday
|
32
40
|
def day_name_for(tach)
|
33
|
-
|
41
|
+
if tach.blank?
|
42
|
+
"Datetime N/A"
|
43
|
+
else
|
34
44
|
tach.strftime("%A")
|
35
45
|
end
|
36
46
|
end
|
37
47
|
|
38
48
|
## Ex. Wed
|
39
49
|
def abbr_day_name_for(tach)
|
40
|
-
|
50
|
+
if tach.blank?
|
51
|
+
"Datetime N/A"
|
52
|
+
else
|
41
53
|
tach.strftime("%a")
|
42
54
|
end
|
43
55
|
end
|
44
56
|
|
45
57
|
## Ex. 07:13 PM
|
46
58
|
def twelve_hour_time_for(tach)
|
47
|
-
|
59
|
+
if tach.blank?
|
60
|
+
"Datetime N/A"
|
61
|
+
else
|
48
62
|
tach.strftime("%I:%M %p")
|
49
63
|
end
|
50
64
|
end
|
51
65
|
|
52
66
|
## Ex. 07:13 PM EST
|
53
67
|
def twelve_hour_time_with_timezone_for(tach)
|
54
|
-
|
68
|
+
if tach.blank?
|
69
|
+
"Datetime N/A"
|
70
|
+
else
|
55
71
|
tach.strftime("%I:%M %p")
|
56
72
|
end
|
57
73
|
end
|
58
74
|
|
59
75
|
## Ex. 19:12
|
60
76
|
def twenty_four_hour_time_for(tach)
|
61
|
-
|
77
|
+
if tach.blank?
|
78
|
+
"Datetime N/A"
|
79
|
+
else
|
62
80
|
tach.strftime("%H:%M")
|
63
81
|
end
|
64
82
|
end
|
65
83
|
|
66
84
|
## Ex. 19:12 EST
|
67
85
|
def twenty_four_hour_time_with_timezone_for(tach)
|
68
|
-
|
86
|
+
if tach.blank?
|
87
|
+
"Datetime N/A"
|
88
|
+
else
|
69
89
|
tach.strftime("%H:%M %Z")
|
70
90
|
end
|
71
91
|
end
|
72
92
|
|
73
93
|
## Ex. December 4 at 07:11 PM
|
74
94
|
def month_day_and_time_for(tach)
|
75
|
-
|
95
|
+
if tach.blank?
|
96
|
+
"Datetime N/A"
|
97
|
+
else
|
76
98
|
tach.strftime("%B %e at %I:%M %p")
|
77
99
|
end
|
78
100
|
end
|
79
101
|
|
80
102
|
## Ex. Dec 4 at 07:11 PM
|
81
103
|
def abbr_month_day_and_time_for(tach)
|
82
|
-
|
104
|
+
if tach.blank?
|
105
|
+
"Datetime N/A"
|
106
|
+
else
|
83
107
|
tach.strftime("%b %e at %I:%M %p")
|
84
108
|
end
|
85
109
|
end
|
86
110
|
|
87
111
|
## Ex. December 4 at 07:11 PM EST
|
88
112
|
def month_day_and_time_with_timezone_for(tach)
|
89
|
-
|
113
|
+
if tach.blank?
|
114
|
+
"Datetime N/A"
|
115
|
+
else
|
90
116
|
tach.strftime("%B %e at %I:%M %p %Z")
|
91
117
|
end
|
92
118
|
end
|
93
119
|
|
94
120
|
## Ex. Dec 4 at 07:11 PM EST
|
95
121
|
def abbr_month_day_and_time_with_timezone_for(tach)
|
96
|
-
|
122
|
+
if tach.blank?
|
123
|
+
"Datetime N/A"
|
124
|
+
else
|
97
125
|
tach.strftime("%b %e at %I:%M %p %Z")
|
98
126
|
end
|
99
127
|
end
|
100
128
|
|
101
129
|
## Ex. December 4, 2013 at 07:11 PM
|
102
130
|
def datetime_for(tach)
|
103
|
-
|
131
|
+
if tach.blank?
|
132
|
+
"Datetime N/A"
|
133
|
+
else
|
104
134
|
tach.strftime("%B %e, %Y at %I:%M %p")
|
105
135
|
end
|
106
136
|
end
|
107
137
|
|
108
138
|
## Ex. Dec 4, 2013 at 07:11 PM
|
109
139
|
def abbr_datetime_for(tach)
|
110
|
-
|
140
|
+
if tach.blank?
|
141
|
+
"Datetime N/A"
|
142
|
+
else
|
111
143
|
tach.strftime("%b %e, %Y at %I:%M %p")
|
112
144
|
end
|
113
145
|
end
|
114
146
|
|
115
147
|
## Ex. December 4, 2013 at 07:11 PM EST
|
116
148
|
def datetime_with_timezone_for(tach)
|
117
|
-
|
149
|
+
if tach.blank?
|
150
|
+
"Datetime N/A"
|
151
|
+
else
|
118
152
|
tach.strftime("%B %e, %Y at %I:%M %p %Z")
|
119
153
|
end
|
120
154
|
end
|
121
155
|
|
122
156
|
## Ex. Dec 4, 2013 at 07:11 PM EST
|
123
157
|
def abbr_datetime_with_timezone_for(tach)
|
124
|
-
|
158
|
+
if tach.blank?
|
159
|
+
"Datetime N/A"
|
160
|
+
else
|
125
161
|
tach.strftime("%b %e, %Y at %I:%M %p %Z")
|
126
162
|
end
|
127
163
|
end
|
128
164
|
|
129
165
|
## Ex. December 4, 2013
|
130
166
|
def date_for(tach)
|
131
|
-
|
167
|
+
if tach.blank?
|
168
|
+
"Datetime N/A"
|
169
|
+
else
|
132
170
|
tach.strftime("%B %e, %Y")
|
133
171
|
end
|
134
172
|
end
|
135
173
|
|
136
174
|
## Ex. Dec 4, 2013
|
137
175
|
def abbr_date_for(tach)
|
138
|
-
|
176
|
+
if tach.blank?
|
177
|
+
"Datetime N/A"
|
178
|
+
else
|
139
179
|
tach.strftime("%b %e, %Y")
|
140
180
|
end
|
141
181
|
end
|
142
182
|
|
143
183
|
## Ex. December 4
|
144
184
|
def month_and_day_for(tach)
|
145
|
-
|
185
|
+
if tach.blank?
|
186
|
+
"Datetime N/A"
|
187
|
+
else
|
146
188
|
tach.strftime("%B %e")
|
147
189
|
end
|
148
190
|
end
|
149
191
|
|
150
192
|
## Ex. Dec 4
|
151
193
|
def abbr_month_and_day_for(tach)
|
152
|
-
|
194
|
+
if tach.blank?
|
195
|
+
"Datetime N/A"
|
196
|
+
else
|
153
197
|
tach.strftime("%b %e")
|
154
198
|
end
|
155
199
|
end
|
156
200
|
|
157
201
|
## Ex. EST
|
158
202
|
def timezone_name_for(tach)
|
159
|
-
|
203
|
+
if tach.blank?
|
204
|
+
"Datetime N/A"
|
205
|
+
else
|
160
206
|
tach.strftime("%Z")
|
161
207
|
end
|
162
208
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drexed-datetime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|