diff --git a/lib/Date/Language.pm b/lib/Date/Language.pm index 229a1c0..77b3e3d 100644 --- a/lib/Date/Language.pm +++ b/lib/Date/Language.pm @@ -110,7 +110,7 @@ L provides objects to parse and format dates for specific langua Danish Norwegian TigrinyaEritrean Dutch Oromo TigrinyaEthiopian English Romanian Turkish - Finnish Russian + Finnish Russian Occitan =head1 METHODS diff --git a/lib/Date/Language/Occitan.pm b/lib/Date/Language/Occitan.pm new file mode 100644 index 0000000..cf58abd --- /dev/null +++ b/lib/Date/Language/Occitan.pm @@ -0,0 +1,36 @@ +## +## Occitan tables, contributed by Quentn PAGÈS +## + +package Date::Language::Occitan; + +use Date::Language (); +use vars qw(@ISA @DoW @DoWs @MoY @MoYs @AMPM @Dsuf %MoY %DoW $VERSION); +@ISA = qw(Date::Language); +$VERSION = "1.04"; + +@DoW = qw(dimenge diluns dimars dimècres dijòus divendres dissabte); +@MoY = qw(genièr febrièr mars abrial mai junh + julhet agost octòbre novembre decembre); +@DoWs = map { substr($_,0,3) } @DoW; +@MoYs = map { substr($_,0,3) } @MoY; +$MoYs[6] = 'jul'; +@AMPM = qw(AM PM); + +@Dsuf = ((qw(er e e e e e e e e e)) x 3, 'er'); + +@MoY{@MoY} = (0 .. scalar(@MoY)); +@MoY{@MoYs} = (0 .. scalar(@MoYs)); +@DoW{@DoW} = (0 .. scalar(@DoW)); +@DoW{@DoWs} = (0 .. scalar(@DoWs)); + +# Formatting routines + +sub format_a { $DoWs[$_[0]->[6]] } +sub format_A { $DoW[$_[0]->[6]] } +sub format_b { $MoYs[$_[0]->[4]] } +sub format_B { $MoY[$_[0]->[4]] } +sub format_h { $MoYs[$_[0]->[4]] } +sub format_p { $_[0]->[2] >= 12 ? $AMPM[1] : $AMPM[0] } + +1;