ydate 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ext/date/date_core.c +9743 -0
- data/ext/date/date_parse.c +3035 -0
- data/ext/date/date_strftime.c +638 -0
- data/ext/date/date_strptime.c +702 -0
- data/ext/date/date_tmx.h +56 -0
- data/ext/date/extconf.rb +9 -0
- data/ext/date/prereq.mk +12 -0
- data/ext/date/zonetab.h +1562 -0
- data/ext/date/zonetab.list +327 -0
- data/lib/date.rb +65 -0
- metadata +54 -0
@@ -0,0 +1,327 @@
|
|
1
|
+
%{
|
2
|
+
struct zone {
|
3
|
+
int name;
|
4
|
+
int offset;
|
5
|
+
};
|
6
|
+
static const struct zone *zonetab();
|
7
|
+
%}
|
8
|
+
|
9
|
+
struct zone;
|
10
|
+
%%
|
11
|
+
ut, 0*3600
|
12
|
+
gmt, 0*3600
|
13
|
+
est, -5*3600
|
14
|
+
edt, -4*3600
|
15
|
+
cst, -6*3600
|
16
|
+
cdt, -5*3600
|
17
|
+
mst, -7*3600
|
18
|
+
mdt, -6*3600
|
19
|
+
pst, -8*3600
|
20
|
+
pdt, -7*3600
|
21
|
+
a, 1*3600
|
22
|
+
b, 2*3600
|
23
|
+
c, 3*3600
|
24
|
+
d, 4*3600
|
25
|
+
e, 5*3600
|
26
|
+
f, 6*3600
|
27
|
+
g, 7*3600
|
28
|
+
h, 8*3600
|
29
|
+
i, 9*3600
|
30
|
+
k, 10*3600
|
31
|
+
l, 11*3600
|
32
|
+
m, 12*3600
|
33
|
+
n, -1*3600
|
34
|
+
o, -2*3600
|
35
|
+
p, -3*3600
|
36
|
+
q, -4*3600
|
37
|
+
r, -5*3600
|
38
|
+
s, -6*3600
|
39
|
+
t, -7*3600
|
40
|
+
u, -8*3600
|
41
|
+
v, -9*3600
|
42
|
+
w, -10*3600
|
43
|
+
x, -11*3600
|
44
|
+
y, -12*3600
|
45
|
+
z, 0*3600
|
46
|
+
utc, 0*3600
|
47
|
+
wet, 0*3600
|
48
|
+
at, -2*3600
|
49
|
+
brst,-2*3600
|
50
|
+
ndt, -(2*3600+1800)
|
51
|
+
art, -3*3600
|
52
|
+
adt, -3*3600
|
53
|
+
brt, -3*3600
|
54
|
+
clst,-3*3600
|
55
|
+
nst, -(3*3600+1800)
|
56
|
+
ast, -4*3600
|
57
|
+
clt, -4*3600
|
58
|
+
akdt,-8*3600
|
59
|
+
ydt, -8*3600
|
60
|
+
akst,-9*3600
|
61
|
+
hadt,-9*3600
|
62
|
+
hdt, -9*3600
|
63
|
+
yst, -9*3600
|
64
|
+
ahst,-10*3600
|
65
|
+
cat,-10*3600
|
66
|
+
hast,-10*3600
|
67
|
+
hst,-10*3600
|
68
|
+
nt, -11*3600
|
69
|
+
idlw,-12*3600
|
70
|
+
bst, 1*3600
|
71
|
+
cet, 1*3600
|
72
|
+
fwt, 1*3600
|
73
|
+
met, 1*3600
|
74
|
+
mewt, 1*3600
|
75
|
+
mez, 1*3600
|
76
|
+
swt, 1*3600
|
77
|
+
wat, 1*3600
|
78
|
+
west, 1*3600
|
79
|
+
cest, 2*3600
|
80
|
+
eet, 2*3600
|
81
|
+
fst, 2*3600
|
82
|
+
mest, 2*3600
|
83
|
+
mesz, 2*3600
|
84
|
+
sast, 2*3600
|
85
|
+
sst, 2*3600
|
86
|
+
bt, 3*3600
|
87
|
+
eat, 3*3600
|
88
|
+
eest, 3*3600
|
89
|
+
msk, 3*3600
|
90
|
+
msd, 4*3600
|
91
|
+
zp4, 4*3600
|
92
|
+
zp5, 5*3600
|
93
|
+
ist, (5*3600+1800)
|
94
|
+
zp6, 6*3600
|
95
|
+
wast, 7*3600
|
96
|
+
cct, 8*3600
|
97
|
+
sgt, 8*3600
|
98
|
+
wadt, 8*3600
|
99
|
+
jst, 9*3600
|
100
|
+
kst, 9*3600
|
101
|
+
east,10*3600
|
102
|
+
gst, 10*3600
|
103
|
+
eadt,11*3600
|
104
|
+
idle,12*3600
|
105
|
+
nzst,12*3600
|
106
|
+
nzt, 12*3600
|
107
|
+
nzdt,13*3600
|
108
|
+
afghanistan, 16200
|
109
|
+
alaskan, -32400
|
110
|
+
arab, 10800
|
111
|
+
arabian, 14400
|
112
|
+
arabic, 10800
|
113
|
+
atlantic, -14400
|
114
|
+
aus central, 34200
|
115
|
+
aus eastern, 36000
|
116
|
+
azores, -3600
|
117
|
+
canada central, -21600
|
118
|
+
cape verde, -3600
|
119
|
+
caucasus, 14400
|
120
|
+
cen. australia, 34200
|
121
|
+
central america, -21600
|
122
|
+
central asia, 21600
|
123
|
+
central europe, 3600
|
124
|
+
central european, 3600
|
125
|
+
central pacific, 39600
|
126
|
+
central, -21600
|
127
|
+
china, 28800
|
128
|
+
dateline, -43200
|
129
|
+
e. africa, 10800
|
130
|
+
e. australia, 36000
|
131
|
+
e. europe, 7200
|
132
|
+
e. south america, -10800
|
133
|
+
eastern, -18000
|
134
|
+
egypt, 7200
|
135
|
+
ekaterinburg, 18000
|
136
|
+
fiji, 43200
|
137
|
+
fle, 7200
|
138
|
+
greenland, -10800
|
139
|
+
greenwich, 0
|
140
|
+
gtb, 7200
|
141
|
+
hawaiian, -36000
|
142
|
+
india, 19800
|
143
|
+
iran, 12600
|
144
|
+
jerusalem, 7200
|
145
|
+
korea, 32400
|
146
|
+
mexico, -21600
|
147
|
+
mid-atlantic, -7200
|
148
|
+
mountain, -25200
|
149
|
+
myanmar, 23400
|
150
|
+
n. central asia, 21600
|
151
|
+
nepal, 20700
|
152
|
+
new zealand, 43200
|
153
|
+
newfoundland, -12600
|
154
|
+
north asia east, 28800
|
155
|
+
north asia, 25200
|
156
|
+
pacific sa, -14400
|
157
|
+
pacific, -28800
|
158
|
+
romance, 3600
|
159
|
+
russian, 10800
|
160
|
+
sa eastern, -10800
|
161
|
+
sa pacific, -18000
|
162
|
+
sa western, -14400
|
163
|
+
samoa, -39600
|
164
|
+
se asia, 25200
|
165
|
+
malay peninsula, 28800
|
166
|
+
south africa, 7200
|
167
|
+
sri lanka, 21600
|
168
|
+
taipei, 28800
|
169
|
+
tasmania, 36000
|
170
|
+
tokyo, 32400
|
171
|
+
tonga, 46800
|
172
|
+
us eastern, -18000
|
173
|
+
us mountain, -25200
|
174
|
+
vladivostok, 36000
|
175
|
+
w. australia, 28800
|
176
|
+
w. central africa, 3600
|
177
|
+
w. europe, 3600
|
178
|
+
west asia, 18000
|
179
|
+
west pacific, 36000
|
180
|
+
yakutsk, 32400
|
181
|
+
acdt,37800
|
182
|
+
acst,34200
|
183
|
+
act,-18000
|
184
|
+
acwst,31500
|
185
|
+
aedt,39600
|
186
|
+
aest,36000
|
187
|
+
aft,16200
|
188
|
+
almt,21600
|
189
|
+
anast,43200
|
190
|
+
anat,43200
|
191
|
+
aoe,-43200
|
192
|
+
aqtt,18000
|
193
|
+
awdt,32400
|
194
|
+
awst,28800
|
195
|
+
azost,0
|
196
|
+
azot,-3600
|
197
|
+
azst,18000
|
198
|
+
azt,14400
|
199
|
+
bnt,28800
|
200
|
+
bot,-14400
|
201
|
+
btt,21600
|
202
|
+
cast,28800
|
203
|
+
chadt,49500
|
204
|
+
chast,45900
|
205
|
+
chost,32400
|
206
|
+
chot,28800
|
207
|
+
chst,36000
|
208
|
+
chut,36000
|
209
|
+
cidst,-14400
|
210
|
+
cist,-18000
|
211
|
+
ckt,-36000
|
212
|
+
cot,-18000
|
213
|
+
cvt,-3600
|
214
|
+
cxt,25200
|
215
|
+
davt,25200
|
216
|
+
ddut,36000
|
217
|
+
easst,-18000
|
218
|
+
ect,-18000
|
219
|
+
egst,0
|
220
|
+
egt,-3600
|
221
|
+
fet,10800
|
222
|
+
fjst,46800
|
223
|
+
fjt,43200
|
224
|
+
fkst,-10800
|
225
|
+
fkt,-14400
|
226
|
+
fnt,-7200
|
227
|
+
galt,-21600
|
228
|
+
gamt,-32400
|
229
|
+
get,14400
|
230
|
+
gft,-10800
|
231
|
+
gilt,43200
|
232
|
+
gyt,-14400
|
233
|
+
hkt,28800
|
234
|
+
hovst,28800
|
235
|
+
hovt,25200
|
236
|
+
ict,25200
|
237
|
+
idt,10800
|
238
|
+
iot,21600
|
239
|
+
irdt,16200
|
240
|
+
irkst,32400
|
241
|
+
irkt,28800
|
242
|
+
irst,12600
|
243
|
+
kgt,21600
|
244
|
+
kost,39600
|
245
|
+
krast,28800
|
246
|
+
krat,25200
|
247
|
+
kuyt,14400
|
248
|
+
lhdt,39600
|
249
|
+
lhst,37800
|
250
|
+
lint,50400
|
251
|
+
magst,43200
|
252
|
+
magt,39600
|
253
|
+
mart,-30600
|
254
|
+
mawt,18000
|
255
|
+
mht,43200
|
256
|
+
mmt,23400
|
257
|
+
mut,14400
|
258
|
+
mvt,18000
|
259
|
+
myt,28800
|
260
|
+
nct,39600
|
261
|
+
nfdt,43200
|
262
|
+
nft,39600
|
263
|
+
novst,25200
|
264
|
+
novt,25200
|
265
|
+
npt,20700
|
266
|
+
nrt,43200
|
267
|
+
nut,-39600
|
268
|
+
omsst,25200
|
269
|
+
omst,21600
|
270
|
+
orat,18000
|
271
|
+
pet,-18000
|
272
|
+
petst,43200
|
273
|
+
pett,43200
|
274
|
+
pgt,36000
|
275
|
+
phot,46800
|
276
|
+
pht,28800
|
277
|
+
pkt,18000
|
278
|
+
pmdt,-7200
|
279
|
+
pmst,-10800
|
280
|
+
pont,39600
|
281
|
+
pwt,32400
|
282
|
+
pyst,-10800
|
283
|
+
qyzt,21600
|
284
|
+
ret,14400
|
285
|
+
rott,-10800
|
286
|
+
sakt,39600
|
287
|
+
samt,14400
|
288
|
+
sbt,39600
|
289
|
+
sct,14400
|
290
|
+
sret,39600
|
291
|
+
srt,-10800
|
292
|
+
syot,10800
|
293
|
+
taht,-36000
|
294
|
+
tft,18000
|
295
|
+
tjt,18000
|
296
|
+
tkt,46800
|
297
|
+
tlt,32400
|
298
|
+
tmt,18000
|
299
|
+
tost,50400
|
300
|
+
tot,46800
|
301
|
+
trt,10800
|
302
|
+
tvt,43200
|
303
|
+
ulast,32400
|
304
|
+
ulat,28800
|
305
|
+
uyst,-7200
|
306
|
+
uyt,-10800
|
307
|
+
uzt,18000
|
308
|
+
vet,-14400
|
309
|
+
vlast,39600
|
310
|
+
vlat,36000
|
311
|
+
vost,21600
|
312
|
+
vut,39600
|
313
|
+
wakt,43200
|
314
|
+
warst,-10800
|
315
|
+
wft,43200
|
316
|
+
wgst,-7200
|
317
|
+
wgt,-10800
|
318
|
+
wib,25200
|
319
|
+
wit,32400
|
320
|
+
wita,28800
|
321
|
+
wt,0
|
322
|
+
yakst,36000
|
323
|
+
yakt,32400
|
324
|
+
yapt,36000
|
325
|
+
yekst,21600
|
326
|
+
yekt,18000
|
327
|
+
%%
|
data/lib/date.rb
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# date.rb: Written by Tadayoshi Funaba 1998-2011
|
3
|
+
|
4
|
+
require 'date_core'
|
5
|
+
|
6
|
+
class Date
|
7
|
+
|
8
|
+
def infinite?
|
9
|
+
false
|
10
|
+
end
|
11
|
+
|
12
|
+
class Infinity < Numeric # :nodoc:
|
13
|
+
|
14
|
+
include Comparable
|
15
|
+
|
16
|
+
def initialize(d=1) @d = d <=> 0 end
|
17
|
+
|
18
|
+
def d() @d end
|
19
|
+
|
20
|
+
protected :d
|
21
|
+
|
22
|
+
def zero?() false end
|
23
|
+
def finite?() false end
|
24
|
+
def infinite?() d.nonzero? end
|
25
|
+
def nan?() d.zero? end
|
26
|
+
|
27
|
+
def abs() self.class.new end
|
28
|
+
|
29
|
+
def -@() self.class.new(-d) end
|
30
|
+
def +@() self.class.new(+d) end
|
31
|
+
|
32
|
+
def <=>(other)
|
33
|
+
case other
|
34
|
+
when Infinity; return d <=> other.d
|
35
|
+
when Numeric; return d
|
36
|
+
else
|
37
|
+
begin
|
38
|
+
l, r = other.coerce(self)
|
39
|
+
return l <=> r
|
40
|
+
rescue NoMethodError
|
41
|
+
end
|
42
|
+
end
|
43
|
+
nil
|
44
|
+
end
|
45
|
+
|
46
|
+
def coerce(other)
|
47
|
+
case other
|
48
|
+
when Numeric; return -d, d
|
49
|
+
else
|
50
|
+
super
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def to_f
|
55
|
+
return 0 if @d == 0
|
56
|
+
if @d > 0
|
57
|
+
Float::INFINITY
|
58
|
+
else
|
59
|
+
-Float::INFINITY
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
metadata
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ydate
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tadayoshi Funaba
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-06-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A subclass of Object includes Comparable module for handling dates.
|
14
|
+
email:
|
15
|
+
-
|
16
|
+
executables: []
|
17
|
+
extensions:
|
18
|
+
- ext/date/extconf.rb
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- ext/date/date_core.c
|
22
|
+
- ext/date/date_parse.c
|
23
|
+
- ext/date/date_strftime.c
|
24
|
+
- ext/date/date_strptime.c
|
25
|
+
- ext/date/date_tmx.h
|
26
|
+
- ext/date/extconf.rb
|
27
|
+
- ext/date/prereq.mk
|
28
|
+
- ext/date/zonetab.h
|
29
|
+
- ext/date/zonetab.list
|
30
|
+
- lib/date.rb
|
31
|
+
homepage: https://github.com/ruby/date
|
32
|
+
licenses:
|
33
|
+
- BSD-2-Clause
|
34
|
+
metadata: {}
|
35
|
+
post_install_message:
|
36
|
+
rdoc_options: []
|
37
|
+
require_paths:
|
38
|
+
- lib
|
39
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 2.4.0
|
44
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
requirements: []
|
50
|
+
rubygems_version: 3.1.2
|
51
|
+
signing_key:
|
52
|
+
specification_version: 4
|
53
|
+
summary: A subclass of Object includes Comparable module for handling dates.
|
54
|
+
test_files: []
|