Permalink
Browse files

Date.new should not die with LTA error

  • Loading branch information...
moritz committed Apr 10, 2012
1 parent 3bd91f5 commit b8fdbeaa1a552b5c09ed14e0f6454ef50deadf62
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/core/Temporal.pm
View
@@ -423,6 +423,15 @@ my class Date does Dateish {
self.new(|$date.split('-').map({.Int}));
}
+ multi method new() {
+ my $n = self.today;
+ if $n.month == 12 && $n.day >= 24 {
+ Date.new($n.year + 1, 12, 24);
+ } else {
+ Date.new($n.year, 12, 24);
+ }
+ }
+
multi method new(DateTime $dt) {
self.bless(*,
:year($dt.year), :month($dt.month), :day($dt.day),

0 comments on commit b8fdbea

Please sign in to comment.