Skip to content

Commit

Permalink
Revert "Introduce Dateish.days-in-year method"
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Oct 18, 2022
1 parent 8cd5768 commit 2ae8b20
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/core.c/Dateish.pm6
Expand Up @@ -23,23 +23,10 @@ my role Dateish {
nqp::atpos_i($days-in-month,$month) ||
($month == 2 ?? 28 + IS-LEAP-YEAR($year) !! Nil );
}

proto method days-in-month(|) {*}
multi method days-in-month(Dateish: Int:D $year, Int:D $month --> Int:D) {
self!DAYS-IN-MONTH($year,$month)
}
multi method days-in-month(Dateish:D: --> Int:D) {
method days-in-month(Dateish:D: --> Int:D) {
self!DAYS-IN-MONTH($!year,$!month)
}

proto method days-in-year(|) {*}
multi method days-in-year(Dateish: Int:D $year --> Int:D) {
365 + IS-LEAP-YEAR($year)
}
multi method days-in-year(Dateish:D: --> Int:D) {
365 + IS-LEAP-YEAR($!year)
}

method !year-Str(--> Str:D) {
sprintf 0 <= $!year <= 9999 ?? '%04d' !! '%+05d', $!year;
}
Expand Down

0 comments on commit 2ae8b20

Please sign in to comment.