Skip to content

Commit ac18efb

Browse files
author
Jan-Olof Hendig
committed
Added documentation for method week-year
1 parent 7db3744 commit ac18efb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

doc/Type/Dateish.pod

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,25 @@ week of the next year.
173173
say Date.new("2014-12-31").week-number; # 1 (first week of 2015)
174174
say Date.new("2016-01-02").week-number; # 53 (last week of 2015)
175175
176+
=head2 method week-year
177+
178+
Defined as:
179+
180+
method week-year(Date:D:) returns Int:D
181+
182+
Usage:
183+
184+
Dateish.week-year
185+
186+
Returns the week year of the date specified by the invocant. Normally C<week-year>
187+
is equal to C<Date.year>. Note however that dates early in January often end up in
188+
the last week of the prior year, and similarly, the final few days of December
189+
may be placed in the first week of the next year.
190+
191+
say Date.new("2015-11-15").week-year; # 2015
192+
say Date.new("2014-12-31").week-year; # 2015 (date belongs to the first week of 2015)
193+
say Date.new("2016-01-02").week-year; # 2015 (date belongs to the last week of 2015)
194+
176195
=head2 method weekday-of-month
177196
178197
Defined as:

0 commit comments

Comments
 (0)