Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things


by Mr. Muskrat (Abbot)
on Dec 12, 2002 at 19:12 UTC ( #219400=sourcecode: print w/ replies, xml ) Need Help??

Category: Date / Time
Author/Contact Info

Matthew Musgove <>
/msg Mr. Muskrat

Description: Another Date::Language sub-module. Look for it on CPAN first quarter 2003.
## Finnish tables
## Contributed by Matthew Musgrove <>

package Date::Language::Finnish;

use Date::Language ();
use vars qw(@ISA @DoW @DoWs @MoY @MoYs @AMPM @Dsuf %MoY %DoW $VERSION)
@ISA = qw(Date::Language);
$VERSION = "1.01";

# In Finnish, the names of the months and days are only capitalized at
+ the beginning of sentences.
@MoY  = map($_ . "kuu", qw(tammi helmi maalis huhti touko kesä heinä e
+lo syys loka marras joulu));
@DoW  = qw(sunnuntai maanantai tiistai keskiviikko torstai perjantai l

# it is not customary to use abbreviated names of months or days
# per Graham's suggestion:
@MoYs = @MoY;
@DoWs = @DoW;

# the short form of ordinals
@Dsuf = ('.') x 31;

# doesn't look like this is normally used...
@AMPM = qw(ap ip);

@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] }
sub format_o { sprintf("%2de",$_[0]->[3]) }


Updated: Thanks roke!

Comment on Date::Language::Finnish
Download Code
Replies are listed 'Best First'.
Re: Date::Language::Finnish
by roke (Curate) on Dec 13, 2002 at 08:46 UTC
    Hi Mr. Muskrat,

    Two small corrections...

    @MoY = map($_ . "kuu", qw(tammi helmi maalis huhti touko kesä heinä e +lo syys loka marras joulu);

    Second ")" is missing in the end of line.

    @DoW = map($_ . "tai", qw(sunnun maanan tiis keskivii tors perjan lau +an));

    Fourth day should be "keskiviikko", not "keskiviitai".


Back to Code Catacombs

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: sourcecode [id://219400]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2015-11-29 13:00 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (750 votes), past polls