Skip to content

Commit 49217b9

Browse files
committed
Correct docs for Dateish.[days-in-month|is-leap-year]
The argument-taking candidates of the two methods were never part of the Perl 6 specification and have now been removed[^1] from Rakudo. [1] rakudo/rakudo@6aab641
1 parent 08a77b9 commit 49217b9

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

doc/Type/Dateish.pod6

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,12 @@ invocant as its only argument.
7171
7272
Defined as:
7373
74-
method is-leap-year($year = self.year) returns Bool:D
74+
method is-leap-year() returns Bool:D
7575
76-
Returns C<True> if C<$year> is a leap year. Can be called as a class method
77-
if the year is provided.
76+
Returns C<True> if the year of the Dateish object is a leap year.
7877
79-
say Dateish.is-leap-year(2016); # True
80-
say Date.new("1900-01-01").is-leap-year; # False
78+
say DateTime.new(:year<2016>).is-leap-year; # True
79+
say Date.new("1900-01-01").is-leap-year; # False
8180
8281
=head2 method day-of-month
8382
@@ -119,12 +118,10 @@ Defined as:
119118
120119
method days-in-month(Dateish:D:) returns Int:D
121120
122-
Returns the number of days in a month, where year and month default to that
123-
of the invocant. If both year and month are provided, it can be called as
124-
a class method.
121+
Returns the number of days in the month represented by the Dateish object:
125122
126-
say Date.new("2016-01-02").days-in-month; # 31
127-
say Dateish.days-in-month(2016, 1); # 31
123+
say Date.new("2016-01-02").days-in-month; # 31
124+
say DateTime.new(:year<10000>, :month<2>).days-in-month; # 29
128125
129126
=head2 method week
130127

0 commit comments

Comments
 (0)