Skip to content

Commit

Permalink
Make Date.truncate-to('day') a no-op
Browse files Browse the repository at this point in the history
Fixes GH-2916
  • Loading branch information
tadzik committed May 23, 2019
1 parent e421e63 commit e943f3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Dateish.pm6
Expand Up @@ -133,6 +133,9 @@ my role Dateish {
self!ymd-from-daycount($new-dc,
%parts<year>,%parts<month>,%parts<day>);
}
elsif $unit eq 'day' | 'days' {
# no-op
}
else { # $unit eq 'month' | 'months' | 'year' | 'years'
%parts<day> = 1;
%parts<month> = 1 if $unit eq 'year' | 'years';
Expand Down

0 comments on commit e943f3e

Please sign in to comment.