Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much


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]
[shmem]: use parens to group expressions
[shmem]: you can't use next in a statement modifier
[shmem]: next requires a BLOCK
[shmem]: same with redo. See also goto hell (shameless plug)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-05-20 18:46 GMT
Find Nodes?
    Voting Booth?