chiark / gitweb /
revert r2430; still useful on chiark
[bin.git] / print-calendar
1 #! /usr/bin/perl -w
2 use strict;
3 use Time::ParseDate;
4
5 my $days = shift;
6 my $unixend = parsedate("now + $days days");
7 die "Usage: $0 days calendar-file" if not defined($unixend);
8
9 while (<>)
10 {
11         chomp;
12         (my $when) = split /[^0-9\/-]/;
13         my $unixwhen = parsedate($when, UK => 1);
14         last if $unixwhen > $unixend;
15         print "$_\n";
16 }