class

Ruby::V4::Date

Inherits Comparable < Reference < Object

Constants

REFORM_JD = 2299161

Constructors

civil(year : Int, mon = 1, day = 1) : self
Source
commercial(cwyear : Int, cweek : Int, cwday : Int) : self

Коммерческая (ISO) неделя.

Source
iso8601(str : String) : self
Source
jd(jd : Int) : self
Source
new(jd : Int64)
Source
new(year : Int, mon = 1, day = 1) : self
Source
ordinal(year : Int, day : Int) : self
Source
parse(str : String) : self
Source
strptime(str : String, fmt : String) : self

strptime: мини-парсер форматов (%Y %m %d %y + буквальные разделители).

Source
today
Source

Class methods

civil_to_jd(y : Int, m : Int, d : Int) : Int64
Source
gregorian_leap?(year : Int) : Bool
Source
jd_to_civil(jd : Int64) : Tuple(Int64, Int64, Int64)

Обратно: {год, месяц, день} в календаре, действующем на этот JD.

Source
leap?(year : Int) : Bool
Source

Instance methods

+(days : Int) : self
Source
-(days : Int) : self
Source
-(other : self) : Int64
Source
<<(n : Int) : self
Source
<=>(other : self) : Int32
Source
==(other : self) : Bool

Returns true if this reference is the same as other. Invokes same?.

Source
>>(n : Int) : self

Ruby month-arithmetic: Date >> n / Date << n (с клампингом дня).

Source
asctime
Source
between?(min : self, max : self) : Bool
Source
civil
Source
cwday
Source
cweek
Source
cweek_year

ISO-неделя: {iso-год, неделя}. Стандартный алгоритм через «четверг этой недели».

Source
cwyear
Source
date_part
Source
downto(limit : self, &block : self -> _) : Nil
Source
downto(limit : self) : Array(self)
Source
friday?
Source
gregorian?
Source
inspect

Returns an unambiguous and information-rich string representation of this object, typically intended for developers.

This method should usually not be overridden. It delegates to #inspect(IO) which can be overridden for custom implementations.

Also see #to_s.

Source
iso8601
Source
julian?
Source
mday
Source
monday?
Source
month
Source
next_day(n = 1) : self
Source
next_month(n = 1) : self
Source
next_year(n = 1) : self
Source
prev_day(n = 1) : self
Source
prev_month(n = 1) : self
Source
prev_year(n = 1) : self
Source
saturday?
Source
step(limit : self, step : Int = 1, &block : self -> _) : Nil
Source
step(limit : self, step : Int = 1) : Array(self)
Source
strftime(fmt : String) : String
Source
succ
Source
sunday?
Source
thursday?
Source
to_datetime

Мост к DateTime (полночь UTC, как в Ruby).

Source
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

Source
to_time

Мост к Time: локальная полночь (как в Ruby Date#to_time).

Source
tuesday?
Source
upto(limit : self, &block : self -> _) : Nil
Source
upto(limit : self) : Array(self)
Source
wday
Source
wednesday?
Source
yday
Source
year
Source