Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris


by Mr. Muskrat (Canon)
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!

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".

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: sourcecode [id://219400]
[trippledubs]: stevie are you still ignoring me
[trippledubs]: either way; sorry.
[trippledubs]: Someone please tell Steveie that I humbly and sincerely apologize

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2017-03-27 03:19 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (315 votes). Check out past polls.