Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make Date.clone take a formatter
- It's one of the easiest ways to alter the formatter
    on an existing Date
- DateTime.clone does take a formatter already
  • Loading branch information
zoffixznet committed May 11, 2017
1 parent 3fb3c27 commit a9a161a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/Date.pm
Expand Up @@ -129,7 +129,8 @@ my class Date does Dateish {
nqp::existskey($h,'year') ?? nqp::atkey($h,'year') !! $!year,
nqp::existskey($h,'month') ?? nqp::atkey($h,'month') !! $!month,
nqp::existskey($h,'day') ?? nqp::atkey($h,'day') !! $!day,
:&!formatter,
formatter => nqp::existskey($h,'formatter')
?? nqp::atkey($h,'formatter') !! &!formatter,
)
}
method !clone-without-validating(*%_) { # A premature optimization.
Expand Down

0 comments on commit a9a161a

Please sign in to comment.