Created
July 29, 2012 16:40
-
-
Save moritz/3200120 to your computer and use it in GitHub Desktop.
Perl 6 related release dates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
sub parrot-release-after(Date $date is copy = Date.today) { | |
$date++ until $date.day-of-week == 2; | |
$date += 7 until ($date - $date.truncated-to(:month)) div 7 == 2; | |
$date; | |
} | |
sub rakudo-release-after(Date $date = Date.today) { | |
parrot-release-after($date) + 2; | |
} | |
sub niecza-release-after(Date $date = Date.today) { | |
my $d = $date.truncated-to(:week); | |
$d += 7 while $d.month == ($d + 7).month; | |
$d; | |
} | |
say 'parrot: ', parrot-release-after; | |
say 'rakudo: ', rakudo-release-after; | |
say 'niecza: ', niecza-release-after; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment