date 3.4.1 → 3.5.1
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/BSDL +22 -0
- data/COPYING +56 -0
- data/README.md +1 -1
- data/ext/date/date_core.c +87 -86
- data/ext/date/date_strptime.c +2 -1
- data/lib/date.rb +1 -1
- metadata +11 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad88171312f53ac18149f50e57442c482c849d06c5f49ff4075373416bc0a8ed
|
|
4
|
+
data.tar.gz: 29b2d8a37e4ccaeaf29e5d85e32c5c57850de8e5438b40e8f8f7a40eace57e6f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 98cf48a5dd42f9ea06cd56c9533408d926e1fa571c862fc5f29325db07c90797bdb0a92336a6c584593f4a3afcf3040335c3c53956b6a95bbfb0b1db15c11ce2
|
|
7
|
+
data.tar.gz: efae967466b4f84107635b4a50051e2d756bad3f5ee1dab8f5890cb4958c182898db1b3f7575ea9da8fc835e42d77f2034d4e0df0928df15dd8758d44e4706bc
|
data/BSDL
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions
|
|
5
|
+
are met:
|
|
6
|
+
1. Redistributions of source code must retain the above copyright
|
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
|
10
|
+
documentation and/or other materials provided with the distribution.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
13
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
14
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
15
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
16
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
17
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
18
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
19
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
20
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
21
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
22
|
+
SUCH DAMAGE.
|
data/COPYING
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
|
3
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
|
4
|
+
|
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
|
6
|
+
software without restriction, provided that you duplicate all of the
|
|
7
|
+
original copyright notices and associated disclaimers.
|
|
8
|
+
|
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
|
10
|
+
you do at least ONE of the following:
|
|
11
|
+
|
|
12
|
+
a. place your modifications in the Public Domain or otherwise
|
|
13
|
+
make them Freely Available, such as by posting said
|
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
|
15
|
+
the author to include your modifications in the software.
|
|
16
|
+
|
|
17
|
+
b. use the modified software only within your corporation or
|
|
18
|
+
organization.
|
|
19
|
+
|
|
20
|
+
c. give non-standard binaries non-standard names, with
|
|
21
|
+
instructions on where to get the original software distribution.
|
|
22
|
+
|
|
23
|
+
d. make other distribution arrangements with the author.
|
|
24
|
+
|
|
25
|
+
3. You may distribute the software in object code or binary form,
|
|
26
|
+
provided that you do at least ONE of the following:
|
|
27
|
+
|
|
28
|
+
a. distribute the binaries and library files of the software,
|
|
29
|
+
together with instructions (in the manual page or equivalent)
|
|
30
|
+
on where to get the original distribution.
|
|
31
|
+
|
|
32
|
+
b. accompany the distribution with the machine-readable source of
|
|
33
|
+
the software.
|
|
34
|
+
|
|
35
|
+
c. give non-standard binaries non-standard names, with
|
|
36
|
+
instructions on where to get the original software distribution.
|
|
37
|
+
|
|
38
|
+
d. make other distribution arrangements with the author.
|
|
39
|
+
|
|
40
|
+
4. You may modify and include the part of the software into any other
|
|
41
|
+
software (possibly commercial). But some files in the distribution
|
|
42
|
+
are not written by the author, so that they are not under these terms.
|
|
43
|
+
|
|
44
|
+
For the list of those files and their copying conditions, see the
|
|
45
|
+
file LEGAL.
|
|
46
|
+
|
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
|
48
|
+
output from the software do not automatically fall under the
|
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
|
51
|
+
software.
|
|
52
|
+
|
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
56
|
+
PURPOSE.
|
data/README.md
CHANGED
data/ext/date/date_core.c
CHANGED
|
@@ -1599,7 +1599,7 @@ m_ajd(union DateData *x)
|
|
|
1599
1599
|
|
|
1600
1600
|
if (simple_dat_p(x)) {
|
|
1601
1601
|
r = m_real_jd(x);
|
|
1602
|
-
if (FIXNUM_P(r) && FIX2LONG(r) <= (FIXNUM_MAX / 2)) {
|
|
1602
|
+
if (FIXNUM_P(r) && FIX2LONG(r) <= (FIXNUM_MAX / 2) && FIX2LONG(r) >= (FIXNUM_MIN + 1) / 2) {
|
|
1603
1603
|
long ir = FIX2LONG(r);
|
|
1604
1604
|
ir = ir * 2 - 1;
|
|
1605
1605
|
return rb_rational_new2(LONG2FIX(ir), INT2FIX(2));
|
|
@@ -2498,7 +2498,7 @@ date_s__valid_jd_p(int argc, VALUE *argv, VALUE klass)
|
|
|
2498
2498
|
*
|
|
2499
2499
|
* Date.valid_jd?(2451944) # => true
|
|
2500
2500
|
*
|
|
2501
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
2501
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
2502
2502
|
*
|
|
2503
2503
|
* Related: Date.jd.
|
|
2504
2504
|
*/
|
|
@@ -2592,7 +2592,7 @@ date_s__valid_civil_p(int argc, VALUE *argv, VALUE klass)
|
|
|
2592
2592
|
* Date.valid_date?(2001, 2, 29) # => false
|
|
2593
2593
|
* Date.valid_date?(2001, 2, -1) # => true
|
|
2594
2594
|
*
|
|
2595
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
2595
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
2596
2596
|
*
|
|
2597
2597
|
* Related: Date.jd, Date.new.
|
|
2598
2598
|
*/
|
|
@@ -2680,7 +2680,7 @@ date_s__valid_ordinal_p(int argc, VALUE *argv, VALUE klass)
|
|
|
2680
2680
|
* Date.valid_ordinal?(2001, 34) # => true
|
|
2681
2681
|
* Date.valid_ordinal?(2001, 366) # => false
|
|
2682
2682
|
*
|
|
2683
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
2683
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
2684
2684
|
*
|
|
2685
2685
|
* Related: Date.jd, Date.ordinal.
|
|
2686
2686
|
*/
|
|
@@ -2770,7 +2770,7 @@ date_s__valid_commercial_p(int argc, VALUE *argv, VALUE klass)
|
|
|
2770
2770
|
*
|
|
2771
2771
|
* See Date.commercial.
|
|
2772
2772
|
*
|
|
2773
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
2773
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
2774
2774
|
*
|
|
2775
2775
|
* Related: Date.jd, Date.commercial.
|
|
2776
2776
|
*/
|
|
@@ -3350,7 +3350,7 @@ static VALUE d_lite_plus(VALUE, VALUE);
|
|
|
3350
3350
|
*
|
|
3351
3351
|
* Date.jd(Date::ITALY - 1).julian? # => true
|
|
3352
3352
|
*
|
|
3353
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
3353
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
3354
3354
|
*
|
|
3355
3355
|
* Related: Date.new.
|
|
3356
3356
|
*/
|
|
@@ -3415,7 +3415,7 @@ date_s_jd(int argc, VALUE *argv, VALUE klass)
|
|
|
3415
3415
|
*
|
|
3416
3416
|
* Raises an exception if +yday+ is zero or out of range.
|
|
3417
3417
|
*
|
|
3418
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
3418
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
3419
3419
|
*
|
|
3420
3420
|
* Related: Date.jd, Date.new.
|
|
3421
3421
|
*/
|
|
@@ -3492,7 +3492,7 @@ date_s_civil(int argc, VALUE *argv, VALUE klass)
|
|
|
3492
3492
|
* where +n+ is the number of days in the month;
|
|
3493
3493
|
* when the argument is negative, counts backward from the end of the month.
|
|
3494
3494
|
*
|
|
3495
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
3495
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
3496
3496
|
*
|
|
3497
3497
|
* Related: Date.jd.
|
|
3498
3498
|
*/
|
|
@@ -3598,7 +3598,7 @@ date_initialize(int argc, VALUE *argv, VALUE self)
|
|
|
3598
3598
|
* Date.commercial(2020, 1, 1).to_s # => "2019-12-30"
|
|
3599
3599
|
Date.commercial(2020, 1, 7).to_s # => "2020-01-05"
|
|
3600
3600
|
*
|
|
3601
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
3601
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
3602
3602
|
*
|
|
3603
3603
|
* Related: Date.jd, Date.new, Date.ordinal.
|
|
3604
3604
|
*/
|
|
@@ -3783,7 +3783,7 @@ static void set_sg(union DateData *, double);
|
|
|
3783
3783
|
*
|
|
3784
3784
|
* Date.today.to_s # => "2022-07-06"
|
|
3785
3785
|
*
|
|
3786
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
3786
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
3787
3787
|
*
|
|
3788
3788
|
*/
|
|
3789
3789
|
static VALUE
|
|
@@ -3878,7 +3878,6 @@ static VALUE
|
|
|
3878
3878
|
rt_complete_frags(VALUE klass, VALUE hash)
|
|
3879
3879
|
{
|
|
3880
3880
|
static VALUE tab = Qnil;
|
|
3881
|
-
int g;
|
|
3882
3881
|
long e;
|
|
3883
3882
|
VALUE k, a, d;
|
|
3884
3883
|
|
|
@@ -3975,9 +3974,13 @@ rt_complete_frags(VALUE klass, VALUE hash)
|
|
|
3975
3974
|
rb_gc_register_mark_object(tab);
|
|
3976
3975
|
}
|
|
3977
3976
|
|
|
3977
|
+
k = a = Qnil;
|
|
3978
|
+
|
|
3978
3979
|
{
|
|
3979
|
-
long i, eno = 0
|
|
3980
|
+
long i, eno = 0;
|
|
3981
|
+
VALUE t = Qnil;
|
|
3980
3982
|
|
|
3983
|
+
e = 0;
|
|
3981
3984
|
for (i = 0; i < RARRAY_LEN(tab); i++) {
|
|
3982
3985
|
VALUE x, a;
|
|
3983
3986
|
|
|
@@ -3992,23 +3995,20 @@ rt_complete_frags(VALUE klass, VALUE hash)
|
|
|
3992
3995
|
n++;
|
|
3993
3996
|
if (n > eno) {
|
|
3994
3997
|
eno = n;
|
|
3995
|
-
|
|
3998
|
+
t = x;
|
|
3996
3999
|
}
|
|
3997
4000
|
}
|
|
3998
4001
|
}
|
|
3999
|
-
if (eno
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
g = 1;
|
|
4003
|
-
k = RARRAY_AREF(RARRAY_AREF(tab, idx), 0);
|
|
4004
|
-
a = RARRAY_AREF(RARRAY_AREF(tab, idx), 1);
|
|
4005
|
-
e = eno;
|
|
4002
|
+
if (eno > 0) {
|
|
4003
|
+
k = RARRAY_AREF(t, 0);
|
|
4004
|
+
a = RARRAY_AREF(t, 1);
|
|
4006
4005
|
}
|
|
4006
|
+
e = eno;
|
|
4007
4007
|
}
|
|
4008
4008
|
|
|
4009
4009
|
d = Qnil;
|
|
4010
4010
|
|
|
4011
|
-
if (
|
|
4011
|
+
if (!NIL_P(k) && (RARRAY_LEN(a) > e)) {
|
|
4012
4012
|
if (k == sym("ordinal")) {
|
|
4013
4013
|
if (NIL_P(ref_hash("year"))) {
|
|
4014
4014
|
if (NIL_P(d))
|
|
@@ -4095,7 +4095,7 @@ rt_complete_frags(VALUE klass, VALUE hash)
|
|
|
4095
4095
|
}
|
|
4096
4096
|
}
|
|
4097
4097
|
|
|
4098
|
-
if (
|
|
4098
|
+
if (k == sym("time")) {
|
|
4099
4099
|
if (f_le_p(klass, cDateTime)) {
|
|
4100
4100
|
if (NIL_P(d))
|
|
4101
4101
|
d = date_s_today(0, (VALUE *)0, cDate);
|
|
@@ -4383,7 +4383,7 @@ date_s__strptime_internal(int argc, VALUE *argv, VALUE klass,
|
|
|
4383
4383
|
* Date._strptime('2001-02-03', '%Y-%m-%d') # => {:year=>2001, :mon=>2, :mday=>3}
|
|
4384
4384
|
*
|
|
4385
4385
|
* For other formats, see
|
|
4386
|
-
* {Formats for Dates and Times}[
|
|
4386
|
+
* {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc].
|
|
4387
4387
|
* (Unlike Date.strftime, does not support flags and width.)
|
|
4388
4388
|
*
|
|
4389
4389
|
* See also {strptime(3)}[https://man7.org/linux/man-pages/man3/strptime.3.html].
|
|
@@ -4412,10 +4412,10 @@ date_s__strptime(int argc, VALUE *argv, VALUE klass)
|
|
|
4412
4412
|
* Date.strptime('sat3feb01', '%a%d%b%y') # => #<Date: 2001-02-03>
|
|
4413
4413
|
*
|
|
4414
4414
|
* For other formats, see
|
|
4415
|
-
* {Formats for Dates and Times}[
|
|
4415
|
+
* {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc].
|
|
4416
4416
|
* (Unlike Date.strftime, does not support flags and width.)
|
|
4417
4417
|
*
|
|
4418
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
4418
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
4419
4419
|
*
|
|
4420
4420
|
* See also {strptime(3)}[https://man7.org/linux/man-pages/man3/strptime.3.html].
|
|
4421
4421
|
*
|
|
@@ -4464,11 +4464,10 @@ get_limit(VALUE opt)
|
|
|
4464
4464
|
#define rb_category_warn(category, fmt) rb_warn(fmt)
|
|
4465
4465
|
#endif
|
|
4466
4466
|
|
|
4467
|
-
static
|
|
4467
|
+
static VALUE
|
|
4468
4468
|
check_limit(VALUE str, VALUE opt)
|
|
4469
4469
|
{
|
|
4470
4470
|
size_t slen, limit;
|
|
4471
|
-
if (NIL_P(str)) return;
|
|
4472
4471
|
StringValue(str);
|
|
4473
4472
|
slen = RSTRING_LEN(str);
|
|
4474
4473
|
limit = get_limit(opt);
|
|
@@ -4476,6 +4475,7 @@ check_limit(VALUE str, VALUE opt)
|
|
|
4476
4475
|
rb_raise(rb_eArgError,
|
|
4477
4476
|
"string length (%"PRI_SIZE_PREFIX"u) exceeds the limit %"PRI_SIZE_PREFIX"u", slen, limit);
|
|
4478
4477
|
}
|
|
4478
|
+
return str;
|
|
4479
4479
|
}
|
|
4480
4480
|
|
|
4481
4481
|
static VALUE
|
|
@@ -4484,8 +4484,7 @@ date_s__parse_internal(int argc, VALUE *argv, VALUE klass)
|
|
|
4484
4484
|
VALUE vstr, vcomp, hash, opt;
|
|
4485
4485
|
|
|
4486
4486
|
argc = rb_scan_args(argc, argv, "11:", &vstr, &vcomp, &opt);
|
|
4487
|
-
check_limit(vstr, opt);
|
|
4488
|
-
StringValue(vstr);
|
|
4487
|
+
vstr = check_limit(vstr, opt);
|
|
4489
4488
|
if (!rb_enc_str_asciicompat_p(vstr))
|
|
4490
4489
|
rb_raise(rb_eArgError,
|
|
4491
4490
|
"string should have ASCII compatible encoding");
|
|
@@ -4505,7 +4504,7 @@ date_s__parse_internal(int argc, VALUE *argv, VALUE klass)
|
|
|
4505
4504
|
* This method recognizes many forms in +string+,
|
|
4506
4505
|
* but it is not a validator.
|
|
4507
4506
|
* For formats, see
|
|
4508
|
-
* {"Specialized Format Strings" in Formats for Dates and Times}[
|
|
4507
|
+
* {"Specialized Format Strings" in Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc@Specialized+Format+Strings]
|
|
4509
4508
|
*
|
|
4510
4509
|
* If +string+ does not specify a valid date,
|
|
4511
4510
|
* the result is unpredictable;
|
|
@@ -4540,7 +4539,7 @@ date_s__parse(int argc, VALUE *argv, VALUE klass)
|
|
|
4540
4539
|
* This method recognizes many forms in +string+,
|
|
4541
4540
|
* but it is not a validator.
|
|
4542
4541
|
* For formats, see
|
|
4543
|
-
* {"Specialized Format Strings" in Formats for Dates and Times}[
|
|
4542
|
+
* {"Specialized Format Strings" in Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc@Specialized+Format+Strings]
|
|
4544
4543
|
* If +string+ does not specify a valid date,
|
|
4545
4544
|
* the result is unpredictable;
|
|
4546
4545
|
* consider using Date._strptime instead.
|
|
@@ -4560,7 +4559,7 @@ date_s__parse(int argc, VALUE *argv, VALUE klass)
|
|
|
4560
4559
|
*
|
|
4561
4560
|
* See:
|
|
4562
4561
|
*
|
|
4563
|
-
* - Argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
4562
|
+
* - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
4564
4563
|
* - Argument {limit}[rdoc-ref:Date@Argument+limit].
|
|
4565
4564
|
*
|
|
4566
4565
|
* Related: Date._parse (returns a hash).
|
|
@@ -4604,7 +4603,7 @@ VALUE date__jisx0301(VALUE);
|
|
|
4604
4603
|
* Date._iso8601(string, limit: 128) -> hash
|
|
4605
4604
|
*
|
|
4606
4605
|
* Returns a hash of values parsed from +string+, which should contain
|
|
4607
|
-
* an {ISO 8601 formatted date}[
|
|
4606
|
+
* an {ISO 8601 formatted date}[rdoc-ref:language/strftime_formatting.rdoc@ISO+8601+Format+Specifications]:
|
|
4608
4607
|
*
|
|
4609
4608
|
* d = Date.new(2001, 2, 3)
|
|
4610
4609
|
* s = d.iso8601 # => "2001-02-03"
|
|
@@ -4620,7 +4619,7 @@ date_s__iso8601(int argc, VALUE *argv, VALUE klass)
|
|
|
4620
4619
|
VALUE str, opt;
|
|
4621
4620
|
|
|
4622
4621
|
rb_scan_args(argc, argv, "1:", &str, &opt);
|
|
4623
|
-
check_limit(str, opt);
|
|
4622
|
+
if (!NIL_P(str)) str = check_limit(str, opt);
|
|
4624
4623
|
|
|
4625
4624
|
return date__iso8601(str);
|
|
4626
4625
|
}
|
|
@@ -4631,7 +4630,7 @@ date_s__iso8601(int argc, VALUE *argv, VALUE klass)
|
|
|
4631
4630
|
*
|
|
4632
4631
|
* Returns a new \Date object with values parsed from +string+,
|
|
4633
4632
|
* which should contain
|
|
4634
|
-
* an {ISO 8601 formatted date}[
|
|
4633
|
+
* an {ISO 8601 formatted date}[rdoc-ref:language/strftime_formatting.rdoc@ISO+8601+Format+Specifications]:
|
|
4635
4634
|
*
|
|
4636
4635
|
* d = Date.new(2001, 2, 3)
|
|
4637
4636
|
* s = d.iso8601 # => "2001-02-03"
|
|
@@ -4639,7 +4638,7 @@ date_s__iso8601(int argc, VALUE *argv, VALUE klass)
|
|
|
4639
4638
|
*
|
|
4640
4639
|
* See:
|
|
4641
4640
|
*
|
|
4642
|
-
* - Argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
4641
|
+
* - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
4643
4642
|
* - Argument {limit}[rdoc-ref:Date@Argument+limit].
|
|
4644
4643
|
*
|
|
4645
4644
|
* Related: Date._iso8601 (returns a hash).
|
|
@@ -4673,7 +4672,7 @@ date_s_iso8601(int argc, VALUE *argv, VALUE klass)
|
|
|
4673
4672
|
* Date._rfc3339(string, limit: 128) -> hash
|
|
4674
4673
|
*
|
|
4675
4674
|
* Returns a hash of values parsed from +string+, which should be a valid
|
|
4676
|
-
* {RFC 3339 format}[
|
|
4675
|
+
* {RFC 3339 format}[rdoc-ref:language/strftime_formatting.rdoc@RFC+3339+Format]:
|
|
4677
4676
|
*
|
|
4678
4677
|
* d = Date.new(2001, 2, 3)
|
|
4679
4678
|
* s = d.rfc3339 # => "2001-02-03T00:00:00+00:00"
|
|
@@ -4690,7 +4689,7 @@ date_s__rfc3339(int argc, VALUE *argv, VALUE klass)
|
|
|
4690
4689
|
VALUE str, opt;
|
|
4691
4690
|
|
|
4692
4691
|
rb_scan_args(argc, argv, "1:", &str, &opt);
|
|
4693
|
-
check_limit(str, opt);
|
|
4692
|
+
if (!NIL_P(str)) str = check_limit(str, opt);
|
|
4694
4693
|
|
|
4695
4694
|
return date__rfc3339(str);
|
|
4696
4695
|
}
|
|
@@ -4701,7 +4700,7 @@ date_s__rfc3339(int argc, VALUE *argv, VALUE klass)
|
|
|
4701
4700
|
*
|
|
4702
4701
|
* Returns a new \Date object with values parsed from +string+,
|
|
4703
4702
|
* which should be a valid
|
|
4704
|
-
* {RFC 3339 format}[
|
|
4703
|
+
* {RFC 3339 format}[rdoc-ref:language/strftime_formatting.rdoc@RFC+3339+Format]:
|
|
4705
4704
|
*
|
|
4706
4705
|
* d = Date.new(2001, 2, 3)
|
|
4707
4706
|
* s = d.rfc3339 # => "2001-02-03T00:00:00+00:00"
|
|
@@ -4709,7 +4708,7 @@ date_s__rfc3339(int argc, VALUE *argv, VALUE klass)
|
|
|
4709
4708
|
*
|
|
4710
4709
|
* See:
|
|
4711
4710
|
*
|
|
4712
|
-
* - Argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
4711
|
+
* - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
4713
4712
|
* - Argument {limit}[rdoc-ref:Date@Argument+limit].
|
|
4714
4713
|
*
|
|
4715
4714
|
* Related: Date._rfc3339 (returns a hash).
|
|
@@ -4759,7 +4758,7 @@ date_s__xmlschema(int argc, VALUE *argv, VALUE klass)
|
|
|
4759
4758
|
VALUE str, opt;
|
|
4760
4759
|
|
|
4761
4760
|
rb_scan_args(argc, argv, "1:", &str, &opt);
|
|
4762
|
-
check_limit(str, opt);
|
|
4761
|
+
if (!NIL_P(str)) str = check_limit(str, opt);
|
|
4763
4762
|
|
|
4764
4763
|
return date__xmlschema(str);
|
|
4765
4764
|
}
|
|
@@ -4777,7 +4776,7 @@ date_s__xmlschema(int argc, VALUE *argv, VALUE klass)
|
|
|
4777
4776
|
*
|
|
4778
4777
|
* See:
|
|
4779
4778
|
*
|
|
4780
|
-
* - Argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
4779
|
+
* - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
4781
4780
|
* - Argument {limit}[rdoc-ref:Date@Argument+limit].
|
|
4782
4781
|
*
|
|
4783
4782
|
* Related: Date._xmlschema (returns a hash).
|
|
@@ -4811,7 +4810,7 @@ date_s_xmlschema(int argc, VALUE *argv, VALUE klass)
|
|
|
4811
4810
|
* Date._rfc2822(string, limit: 128) -> hash
|
|
4812
4811
|
*
|
|
4813
4812
|
* Returns a hash of values parsed from +string+, which should be a valid
|
|
4814
|
-
* {RFC 2822 date format}[
|
|
4813
|
+
* {RFC 2822 date format}[rdoc-ref:language/strftime_formatting.rdoc@RFC+2822+Format]:
|
|
4815
4814
|
*
|
|
4816
4815
|
* d = Date.new(2001, 2, 3)
|
|
4817
4816
|
* s = d.rfc2822 # => "Sat, 3 Feb 2001 00:00:00 +0000"
|
|
@@ -4828,7 +4827,7 @@ date_s__rfc2822(int argc, VALUE *argv, VALUE klass)
|
|
|
4828
4827
|
VALUE str, opt;
|
|
4829
4828
|
|
|
4830
4829
|
rb_scan_args(argc, argv, "1:", &str, &opt);
|
|
4831
|
-
check_limit(str, opt);
|
|
4830
|
+
if (!NIL_P(str)) str = check_limit(str, opt);
|
|
4832
4831
|
|
|
4833
4832
|
return date__rfc2822(str);
|
|
4834
4833
|
}
|
|
@@ -4839,7 +4838,7 @@ date_s__rfc2822(int argc, VALUE *argv, VALUE klass)
|
|
|
4839
4838
|
*
|
|
4840
4839
|
* Returns a new \Date object with values parsed from +string+,
|
|
4841
4840
|
* which should be a valid
|
|
4842
|
-
* {RFC 2822 date format}[
|
|
4841
|
+
* {RFC 2822 date format}[rdoc-ref:language/strftime_formatting.rdoc@RFC+2822+Format]:
|
|
4843
4842
|
*
|
|
4844
4843
|
* d = Date.new(2001, 2, 3)
|
|
4845
4844
|
* s = d.rfc2822 # => "Sat, 3 Feb 2001 00:00:00 +0000"
|
|
@@ -4847,7 +4846,7 @@ date_s__rfc2822(int argc, VALUE *argv, VALUE klass)
|
|
|
4847
4846
|
*
|
|
4848
4847
|
* See:
|
|
4849
4848
|
*
|
|
4850
|
-
* - Argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
4849
|
+
* - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
4851
4850
|
* - Argument {limit}[rdoc-ref:Date@Argument+limit].
|
|
4852
4851
|
*
|
|
4853
4852
|
* Related: Date._rfc2822 (returns a hash).
|
|
@@ -4881,7 +4880,7 @@ date_s_rfc2822(int argc, VALUE *argv, VALUE klass)
|
|
|
4881
4880
|
* Date._httpdate(string, limit: 128) -> hash
|
|
4882
4881
|
*
|
|
4883
4882
|
* Returns a hash of values parsed from +string+, which should be a valid
|
|
4884
|
-
* {HTTP date format}[
|
|
4883
|
+
* {HTTP date format}[rdoc-ref:language/strftime_formatting.rdoc@HTTP+Format]:
|
|
4885
4884
|
*
|
|
4886
4885
|
* d = Date.new(2001, 2, 3)
|
|
4887
4886
|
* s = d.httpdate # => "Sat, 03 Feb 2001 00:00:00 GMT"
|
|
@@ -4896,7 +4895,7 @@ date_s__httpdate(int argc, VALUE *argv, VALUE klass)
|
|
|
4896
4895
|
VALUE str, opt;
|
|
4897
4896
|
|
|
4898
4897
|
rb_scan_args(argc, argv, "1:", &str, &opt);
|
|
4899
|
-
check_limit(str, opt);
|
|
4898
|
+
if (!NIL_P(str)) str = check_limit(str, opt);
|
|
4900
4899
|
|
|
4901
4900
|
return date__httpdate(str);
|
|
4902
4901
|
}
|
|
@@ -4907,7 +4906,7 @@ date_s__httpdate(int argc, VALUE *argv, VALUE klass)
|
|
|
4907
4906
|
*
|
|
4908
4907
|
* Returns a new \Date object with values parsed from +string+,
|
|
4909
4908
|
* which should be a valid
|
|
4910
|
-
* {HTTP date format}[
|
|
4909
|
+
* {HTTP date format}[rdoc-ref:language/strftime_formatting.rdoc@HTTP+Format]:
|
|
4911
4910
|
*
|
|
4912
4911
|
* d = Date.new(2001, 2, 3)
|
|
4913
4912
|
s = d.httpdate # => "Sat, 03 Feb 2001 00:00:00 GMT"
|
|
@@ -4915,7 +4914,7 @@ date_s__httpdate(int argc, VALUE *argv, VALUE klass)
|
|
|
4915
4914
|
*
|
|
4916
4915
|
* See:
|
|
4917
4916
|
*
|
|
4918
|
-
* - Argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
4917
|
+
* - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
4919
4918
|
* - Argument {limit}[rdoc-ref:Date@Argument+limit].
|
|
4920
4919
|
*
|
|
4921
4920
|
* Related: Date._httpdate (returns a hash).
|
|
@@ -4949,7 +4948,7 @@ date_s_httpdate(int argc, VALUE *argv, VALUE klass)
|
|
|
4949
4948
|
* Date._jisx0301(string, limit: 128) -> hash
|
|
4950
4949
|
*
|
|
4951
4950
|
* Returns a hash of values parsed from +string+, which should be a valid
|
|
4952
|
-
* {JIS X 0301 date format}[
|
|
4951
|
+
* {JIS X 0301 date format}[rdoc-ref:language/strftime_formatting.rdoc@JIS+X+0301+Format]:
|
|
4953
4952
|
*
|
|
4954
4953
|
* d = Date.new(2001, 2, 3)
|
|
4955
4954
|
* s = d.jisx0301 # => "H13.02.03"
|
|
@@ -4965,7 +4964,7 @@ date_s__jisx0301(int argc, VALUE *argv, VALUE klass)
|
|
|
4965
4964
|
VALUE str, opt;
|
|
4966
4965
|
|
|
4967
4966
|
rb_scan_args(argc, argv, "1:", &str, &opt);
|
|
4968
|
-
check_limit(str, opt);
|
|
4967
|
+
if (!NIL_P(str)) str = check_limit(str, opt);
|
|
4969
4968
|
|
|
4970
4969
|
return date__jisx0301(str);
|
|
4971
4970
|
}
|
|
@@ -4975,7 +4974,7 @@ date_s__jisx0301(int argc, VALUE *argv, VALUE klass)
|
|
|
4975
4974
|
* Date.jisx0301(string = '-4712-01-01', start = Date::ITALY, limit: 128) -> date
|
|
4976
4975
|
*
|
|
4977
4976
|
* Returns a new \Date object with values parsed from +string+,
|
|
4978
|
-
* which should be a valid {JIS X 0301 format}[
|
|
4977
|
+
* which should be a valid {JIS X 0301 format}[rdoc-ref:language/strftime_formatting.rdoc@JIS+X+0301+Format]:
|
|
4979
4978
|
*
|
|
4980
4979
|
* d = Date.new(2001, 2, 3)
|
|
4981
4980
|
* s = d.jisx0301 # => "H13.02.03"
|
|
@@ -4987,7 +4986,7 @@ date_s__jisx0301(int argc, VALUE *argv, VALUE klass)
|
|
|
4987
4986
|
*
|
|
4988
4987
|
* See:
|
|
4989
4988
|
*
|
|
4990
|
-
* - Argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
4989
|
+
* - Argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
4991
4990
|
* - Argument {limit}[rdoc-ref:Date@Argument+limit].
|
|
4992
4991
|
*
|
|
4993
4992
|
* Related: Date._jisx0301 (returns a hash).
|
|
@@ -5745,7 +5744,7 @@ d_lite_leap_p(VALUE self)
|
|
|
5745
5744
|
* Date.new(2001, 2, 3, Date::GREGORIAN).start # => -Infinity
|
|
5746
5745
|
* Date.new(2001, 2, 3, Date::JULIAN).start # => Infinity
|
|
5747
5746
|
*
|
|
5748
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
5747
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
5749
5748
|
*
|
|
5750
5749
|
*/
|
|
5751
5750
|
static VALUE
|
|
@@ -5820,7 +5819,7 @@ dup_obj_with_new_start(VALUE obj, double sg)
|
|
|
5820
5819
|
* d1 = d0.new_start(Date::JULIAN)
|
|
5821
5820
|
* d1.julian? # => true
|
|
5822
5821
|
*
|
|
5823
|
-
* See argument {start}[rdoc-ref:calendars.rdoc@Argument+start].
|
|
5822
|
+
* See argument {start}[rdoc-ref:language/calendars.rdoc@Argument+start].
|
|
5824
5823
|
*
|
|
5825
5824
|
*/
|
|
5826
5825
|
static VALUE
|
|
@@ -6936,13 +6935,24 @@ d_lite_eql_p(VALUE self, VALUE other)
|
|
|
6936
6935
|
static VALUE
|
|
6937
6936
|
d_lite_hash(VALUE self)
|
|
6938
6937
|
{
|
|
6939
|
-
st_index_t v, h[
|
|
6938
|
+
st_index_t v, h[5];
|
|
6939
|
+
VALUE nth;
|
|
6940
6940
|
|
|
6941
6941
|
get_d1(self);
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6942
|
+
nth = m_nth(dat);
|
|
6943
|
+
|
|
6944
|
+
if (FIXNUM_P(nth)) {
|
|
6945
|
+
h[0] = 0;
|
|
6946
|
+
h[1] = (st_index_t)nth;
|
|
6947
|
+
} else {
|
|
6948
|
+
h[0] = 1;
|
|
6949
|
+
h[1] = (st_index_t)FIX2LONG(rb_hash(nth));
|
|
6950
|
+
}
|
|
6951
|
+
|
|
6952
|
+
h[2] = m_jd(dat);
|
|
6953
|
+
h[3] = m_df(dat);
|
|
6954
|
+
h[4] = m_sf(dat);
|
|
6955
|
+
|
|
6946
6956
|
v = rb_memhash(h, sizeof(h));
|
|
6947
6957
|
return ST2FIX(v);
|
|
6948
6958
|
}
|
|
@@ -6957,7 +6967,7 @@ static VALUE strftimev(const char *, VALUE,
|
|
|
6957
6967
|
* to_s -> string
|
|
6958
6968
|
*
|
|
6959
6969
|
* Returns a string representation of the date in +self+
|
|
6960
|
-
* in {ISO 8601 extended date format}[
|
|
6970
|
+
* in {ISO 8601 extended date format}[rdoc-ref:language/strftime_formatting.rdoc@ISO+8601+Format+Specifications]
|
|
6961
6971
|
* (<tt>'%Y-%m-%d'</tt>):
|
|
6962
6972
|
*
|
|
6963
6973
|
* Date.new(2001, 2, 3).to_s # => "2001-02-03"
|
|
@@ -7238,7 +7248,7 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
|
|
|
7238
7248
|
* Date.new(2001, 2, 3).strftime # => "2001-02-03"
|
|
7239
7249
|
*
|
|
7240
7250
|
* For other formats, see
|
|
7241
|
-
* {Formats for Dates and Times}[
|
|
7251
|
+
* {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc].
|
|
7242
7252
|
*
|
|
7243
7253
|
*/
|
|
7244
7254
|
static VALUE
|
|
@@ -7270,7 +7280,7 @@ strftimev(const char *fmt, VALUE self,
|
|
|
7270
7280
|
* asctime -> string
|
|
7271
7281
|
*
|
|
7272
7282
|
* Equivalent to #strftime with argument <tt>'%a %b %e %T %Y'</tt>
|
|
7273
|
-
* (or its {shorthand form}[
|
|
7283
|
+
* (or its {shorthand form}[rdoc-ref:language/strftime_formatting.rdoc@Shorthand+Conversion+Specifiers]
|
|
7274
7284
|
* <tt>'%c'</tt>):
|
|
7275
7285
|
*
|
|
7276
7286
|
* Date.new(2001, 2, 3).asctime # => "Sat Feb 3 00:00:00 2001"
|
|
@@ -7289,7 +7299,7 @@ d_lite_asctime(VALUE self)
|
|
|
7289
7299
|
* iso8601 -> string
|
|
7290
7300
|
*
|
|
7291
7301
|
* Equivalent to #strftime with argument <tt>'%Y-%m-%d'</tt>
|
|
7292
|
-
* (or its {shorthand form}[
|
|
7302
|
+
* (or its {shorthand form}[rdoc-ref:language/strftime_formatting.rdoc@Shorthand+Conversion+Specifiers]
|
|
7293
7303
|
* <tt>'%F'</tt>);
|
|
7294
7304
|
*
|
|
7295
7305
|
* Date.new(2001, 2, 3).iso8601 # => "2001-02-03"
|
|
@@ -7306,7 +7316,7 @@ d_lite_iso8601(VALUE self)
|
|
|
7306
7316
|
* rfc3339 -> string
|
|
7307
7317
|
*
|
|
7308
7318
|
* Equivalent to #strftime with argument <tt>'%FT%T%:z'</tt>;
|
|
7309
|
-
* see {Formats for Dates and Times}[
|
|
7319
|
+
* see {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc]:
|
|
7310
7320
|
*
|
|
7311
7321
|
* Date.new(2001, 2, 3).rfc3339 # => "2001-02-03T00:00:00+00:00"
|
|
7312
7322
|
*
|
|
@@ -7322,7 +7332,7 @@ d_lite_rfc3339(VALUE self)
|
|
|
7322
7332
|
* rfc2822 -> string
|
|
7323
7333
|
*
|
|
7324
7334
|
* Equivalent to #strftime with argument <tt>'%a, %-d %b %Y %T %z'</tt>;
|
|
7325
|
-
* see {Formats for Dates and Times}[
|
|
7335
|
+
* see {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc]:
|
|
7326
7336
|
*
|
|
7327
7337
|
* Date.new(2001, 2, 3).rfc2822 # => "Sat, 3 Feb 2001 00:00:00 +0000"
|
|
7328
7338
|
*
|
|
@@ -7338,7 +7348,7 @@ d_lite_rfc2822(VALUE self)
|
|
|
7338
7348
|
* httpdate -> string
|
|
7339
7349
|
*
|
|
7340
7350
|
* Equivalent to #strftime with argument <tt>'%a, %d %b %Y %T GMT'</tt>;
|
|
7341
|
-
* see {Formats for Dates and Times}[
|
|
7351
|
+
* see {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc]:
|
|
7342
7352
|
*
|
|
7343
7353
|
* Date.new(2001, 2, 3).httpdate # => "Sat, 03 Feb 2001 00:00:00 GMT"
|
|
7344
7354
|
*
|
|
@@ -7517,10 +7527,7 @@ d_lite_marshal_dump_old(VALUE self)
|
|
|
7517
7527
|
m_of_in_day(dat),
|
|
7518
7528
|
DBL2NUM(m_sg(dat)));
|
|
7519
7529
|
|
|
7520
|
-
|
|
7521
|
-
rb_copy_generic_ivar(a, self);
|
|
7522
|
-
FL_SET(a, FL_EXIVAR);
|
|
7523
|
-
}
|
|
7530
|
+
rb_copy_generic_ivar(a, self);
|
|
7524
7531
|
|
|
7525
7532
|
return a;
|
|
7526
7533
|
}
|
|
@@ -7542,10 +7549,8 @@ d_lite_marshal_dump(VALUE self)
|
|
|
7542
7549
|
INT2FIX(m_of(dat)),
|
|
7543
7550
|
DBL2NUM(m_sg(dat)));
|
|
7544
7551
|
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
FL_SET(a, FL_EXIVAR);
|
|
7548
|
-
}
|
|
7552
|
+
|
|
7553
|
+
rb_copy_generic_ivar(a, self);
|
|
7549
7554
|
|
|
7550
7555
|
return a;
|
|
7551
7556
|
}
|
|
@@ -7618,10 +7623,7 @@ d_lite_marshal_load(VALUE self, VALUE a)
|
|
|
7618
7623
|
HAVE_JD | HAVE_DF);
|
|
7619
7624
|
}
|
|
7620
7625
|
|
|
7621
|
-
|
|
7622
|
-
rb_copy_generic_ivar(self, a);
|
|
7623
|
-
FL_SET(self, FL_EXIVAR);
|
|
7624
|
-
}
|
|
7626
|
+
rb_copy_generic_ivar(self, a);
|
|
7625
7627
|
|
|
7626
7628
|
return self;
|
|
7627
7629
|
}
|
|
@@ -8715,7 +8717,7 @@ dt_lite_to_s(VALUE self)
|
|
|
8715
8717
|
* DateTime.now.strftime # => "2022-07-01T11:03:19-05:00"
|
|
8716
8718
|
*
|
|
8717
8719
|
* For other formats,
|
|
8718
|
-
* see {Formats for Dates and Times}[
|
|
8720
|
+
* see {Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc]:
|
|
8719
8721
|
*
|
|
8720
8722
|
*/
|
|
8721
8723
|
static VALUE
|
|
@@ -9494,6 +9496,7 @@ Init_date_core(void)
|
|
|
9494
9496
|
sym_zone = ID2SYM(rb_intern_const("zone"));
|
|
9495
9497
|
|
|
9496
9498
|
half_days_in_day = rb_rational_new2(INT2FIX(1), INT2FIX(2));
|
|
9499
|
+
rb_gc_register_mark_object(half_days_in_day);
|
|
9497
9500
|
|
|
9498
9501
|
#if (LONG_MAX / DAY_IN_SECONDS) > SECOND_IN_NANOSECONDS
|
|
9499
9502
|
day_in_nanoseconds = LONG2NUM((long)DAY_IN_SECONDS *
|
|
@@ -9505,8 +9508,6 @@ Init_date_core(void)
|
|
|
9505
9508
|
day_in_nanoseconds = f_mul(INT2FIX(DAY_IN_SECONDS),
|
|
9506
9509
|
INT2FIX(SECOND_IN_NANOSECONDS));
|
|
9507
9510
|
#endif
|
|
9508
|
-
|
|
9509
|
-
rb_gc_register_mark_object(half_days_in_day);
|
|
9510
9511
|
rb_gc_register_mark_object(day_in_nanoseconds);
|
|
9511
9512
|
|
|
9512
9513
|
positive_inf = +INFINITY;
|
|
@@ -9517,12 +9518,12 @@ Init_date_core(void)
|
|
|
9517
9518
|
* calendar dates.
|
|
9518
9519
|
*
|
|
9519
9520
|
* Consider using
|
|
9520
|
-
* {class Time}[
|
|
9521
|
+
* {class Time}[rdoc-ref:Time]
|
|
9521
9522
|
* instead of class \Date if:
|
|
9522
9523
|
*
|
|
9523
9524
|
* - You need both dates and times; \Date handles only dates.
|
|
9524
9525
|
* - You need only Gregorian dates (and not Julian dates);
|
|
9525
|
-
* see {Julian and Gregorian Calendars}[rdoc-ref:calendars.rdoc].
|
|
9526
|
+
* see {Julian and Gregorian Calendars}[rdoc-ref:language/calendars.rdoc].
|
|
9526
9527
|
*
|
|
9527
9528
|
* A \Date object, once created, is immutable, and cannot be modified.
|
|
9528
9529
|
*
|
|
@@ -9569,7 +9570,7 @@ Init_date_core(void)
|
|
|
9569
9570
|
* Date.strptime('fri31dec99', '%a%d%b%y') # => #<Date: 1999-12-31>
|
|
9570
9571
|
*
|
|
9571
9572
|
* See also the specialized methods in
|
|
9572
|
-
* {"Specialized Format Strings" in Formats for Dates and Times}[
|
|
9573
|
+
* {"Specialized Format Strings" in Formats for Dates and Times}[rdoc-ref:language/strftime_formatting.rdoc@Specialized+Format+Strings]
|
|
9573
9574
|
*
|
|
9574
9575
|
* == Argument +limit+
|
|
9575
9576
|
*
|
data/ext/date/date_strptime.c
CHANGED
data/lib/date.rb
CHANGED
metadata
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: date
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tadayoshi Funaba
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2025-12-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description:
|
|
13
|
+
description: The official date library for Ruby.
|
|
14
14
|
email:
|
|
15
|
-
-
|
|
15
|
+
-
|
|
16
16
|
executables: []
|
|
17
17
|
extensions:
|
|
18
18
|
- ext/date/extconf.rb
|
|
19
19
|
extra_rdoc_files: []
|
|
20
20
|
files:
|
|
21
|
+
- BSDL
|
|
22
|
+
- COPYING
|
|
21
23
|
- README.md
|
|
22
24
|
- ext/date/date_core.c
|
|
23
25
|
- ext/date/date_parse.c
|
|
@@ -35,7 +37,7 @@ licenses:
|
|
|
35
37
|
- BSD-2-Clause
|
|
36
38
|
metadata:
|
|
37
39
|
changelog_uri: https://github.com/ruby/date/releases
|
|
38
|
-
post_install_message:
|
|
40
|
+
post_install_message:
|
|
39
41
|
rdoc_options: []
|
|
40
42
|
require_paths:
|
|
41
43
|
- lib
|
|
@@ -50,8 +52,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
50
52
|
- !ruby/object:Gem::Version
|
|
51
53
|
version: '0'
|
|
52
54
|
requirements: []
|
|
53
|
-
rubygems_version: 3.5.
|
|
54
|
-
signing_key:
|
|
55
|
+
rubygems_version: 3.5.22
|
|
56
|
+
signing_key:
|
|
55
57
|
specification_version: 4
|
|
56
|
-
summary:
|
|
58
|
+
summary: The official date library for Ruby.
|
|
57
59
|
test_files: []
|