Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RT #121990 DateTime/Date smartmatching
  • Loading branch information
perlpilot committed Jul 30, 2014
1 parent 11e1937 commit 509b1a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/Temporal.pm
Expand Up @@ -603,6 +603,10 @@ my class Date does Dateish {
multi method perl(Date:D:) {
"Date.new($.year.perl(), $.month.perl(), $.day.perl())";
}

multi method ACCEPTS(Date:D: DateTime:D $dt) {
return $dt.year == $.year && $dt.month == $.month && $dt.day == $.day;
}
}

multi infix:<+>(Date:D $d, Int:D $x) {
Expand Down

0 comments on commit 509b1a4

Please sign in to comment.