package Lire::WeekCalculator; use strict; use Carp; use Time::Local; use POSIX qw/ strftime mktime localtime /; use Lire::Config; use vars qw/ $haveV /; =pod =head1 NAME Lire::WeekCalculator - handle different weeknumbering schemes =head1 SYNOPSIS use Lire::WeekCalculator; my $week_calc = new Lire::WeekCalculator(); my $week_no = $week_calc->week_number( $time ); =head1 DESCRIPTION We support three values for LR_WEEK_NUMBERING: ISO (strftime's %V): week starts on monday; W (week starts on monday) and U (week starts on sunday). See strftime(1). =cut # week numbering voodoo: # in non-iso case, some weeks have two names: # sunday december 30 2001 - saturday jan 5 2002 is known as # 2001's week 53 and 2002's week 00, in the %U case. We use # only the 2001 week 53 name for this (complete) week. Lire # never shows statistics for week 00. A similar case holds # for %W numbering. # # requirements: #We should contruct Lire_number from a date and config, and construct #weekstring from Lire_number and config =pod =head1 CONSTRUCTOR =head2 new( %params ) Creates a new week calculator. The style of week numbering is selected using the C