End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Date#new_start
d.new_start([start=Date::ITALY]) → date
ext/date/date_core.c
View on GitHub ↗
static VALUE
d_lite_new_start(int argc, VALUE *argv, VALUE self)
{
VALUE vsg;
double sg;
rb_scan_args(argc, argv, "01", &vsg);
sg = DEFAULT_SG;
if (argc >= 1)
val2sg(vsg, sg);
return dup_obj_with_new_start(self, sg);
}
Duplicates self and resets its day of calendar reform.
Example
d = Date.new(1582,10,15) d.new_start(Date::JULIAN) #=> #<Date: 1582-10-05 ...>