package Common::Date::Half;

use base 'Common::Date';

sub priority { 750 }
sub type     { 'half' }

sub _patterns {
    [
        #2011 1H 2011 H1
        new Common::Date::Pattern( pattern => '(\d{4})\s*([12])h', month => 2, year => 1 ),
        new Common::Date::Pattern( pattern => '(\d{4})\s*h([12])', month => 2, year => 1 ),
    ];
}

sub month {
    my $self = shift;

    my $endMonth = $self->{_month} * 6;

    return $endMonth - 5;
}

1;
