D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Date
/
Filename :
commercial-c.ri
back
Copy
U:RDoc::AnyMethod[iI"commercial:ETI"Date::commercial;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"?Returns a new \Date object constructed from the arguments.;To:RDoc::Markup::BlankLine o; ; [I"@Argument +cwyear+ gives the year, and should be an integer.;T@o; ; [ I"CArgument +cweek+ gives the index of the week within the year, ;TI"2and should be in range (1..53) or (-53..-1); ;TI"4in some years, 53 or -53 will be out-of-range; ;TI";if negative, counts backward from the end of the year:;T@o:RDoc::Markup::Verbatim; [I"9Date.commercial(2022, 1, 1).to_s # => "2022-01-03" ;TI"9Date.commercial(2022, 52, 1).to_s # => "2022-12-26" ;T:@format0o; ; [ I"FArgument +cwday+ gives the indes of the weekday within the week, ;TI"0and should be in range (1..7) or (-7..-1); ;TI"1 or -7 is Monday; ;TI";if negative, counts backward from the end of the week:;T@o;; [I"9Date.commercial(2022, 1, 1).to_s # => "2022-01-03" ;TI"9Date.commercial(2022, 1, -7).to_s # => "2022-01-03" ;T; 0o; ; [I"When +cweek+ is 1:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"4If January 1 is a Friday, Saturday, or Sunday, ;TI"-the first week begins in the week after:;T@o;; [I"?Date::ABBR_DAYNAMES[Date.new(2023, 1, 1).wday] # => "Sun" ;TI"8Date.commercial(2023, 1, 1).to_s # => "2023-01-02" ;TI"8Date.commercial(2023, 1, 7).to_s # => "2023-01-08" ;T; 0o;;0; [o; ; [I"9Otherwise, the first week is the week of January 1, ;TI"=which may mean some of the days fall on the year before:;T@o;; [I"?Date::ABBR_DAYNAMES[Date.new(2020, 1, 1).wday] # => "Wed" ;TI"8Date.commercial(2020, 1, 1).to_s # => "2019-12-30" ;TI"8Date.commercial(2020, 1, 7).to_s # => "2020-01-05" ;T; 0o; ; [I"GSee argument {start}[rdoc-ref:date/calendars.rdoc@Argument+start].;T@o; ; [I".Related: Date.jd, Date.new, Date.ordinal.;T: @fileI"ext/date/date_core.c;T:0@omit_headings_from_table_of_contents_below0I"XDate.commercial(cwyear = -4712, cweek = 1, cwday = 1, start = Date::ITALY) -> date ;T0[ I")(p1 = v1, p2 = v2, p3 = v3, p4 = v4);T@GFI" Date;TcRDoc::NormalClass00