Here are the docs:
NAME
DateTime::Fiscal::Nrf454 - Perl extension to create 4-5-4 calendar dates
from a DateTime object.
SYNOPSIS
use DateTime::Fiscal::Nrf454;
my $nrf = DateTime::Fiscal::Nrg454->new( nrfyear => 2006 );
if ( $nrf->is_nrf_leap_year ) {
# do something here
}
my $fiscalyear = $nrf->nrf_year;
my $startdate = $nrf->nrf_start; # start of fiscal year
my $enddate = $nrf->nrf_end; # end of fiscal year
my @fiscalperiod_data = $nrf->nrf_period; # returns all period
data
my $fp_number = $nrf->nrf_period; # returns period number
my $fp_weeks = $nrf->nrf_period_weeks; # number of weeks in
period
my $fp_start = $nrf->nrf_period_start; # period start date
my $fp_end = $nrf->nrf_period_end; # period end date
See the details below for each method for options.
DESCRIPTION
This module is a sub-class of "DateTime" and inherits all methods and
capabilities, including contructors, of that module.
The purpose of this module is to make it easy to work with the 4-5-4
calendar that is common among merchandisers. Details of the calendar
itself can be found at the National Retailers Federation (NRF) website.
(http://www.nrf.com/content/default.asp?folder=services&file=finance_454
.htm)
All objects returned by any of the methods in this module or of the
class "DateTime::Fiscal::Nrf454" unless otherwise specified.
EXPORT
None.
DEPENDENCIES
Carp
DateTime
CONSTRUCTORS
All of the constructors from the parent "DateTime" class can be used to
obtain a new object.
In addition, the "new" constructor accepts an additional parameter named
'nrfyear' that overides any date parameters (i.e. "year") that may be
present.
new
my $nrf = DateTime::Fiscal::Nrf454->new( nrfyear => 2000 );
my $nrf2 = new DateTime::Fiscal::Nrf454 nrfyear => 2000;
Returns an object of type "DateTime::Fiscal::Nrf454".
If the "nrfyear" option is given then the object will be initialized to
the start of the given FISCAL YEAR. In the example shown this is
"2000-01-30T00:00:00".
NOTE: The "nrfyear" parameter automatically overrides any values
provided for the parameters "year", "month" and "day".
METHODS
nrf_year
my $nrf = DateTime::Fiscal::Nrf454->new( year => 2006, month = 4 );
print $nrf->nrf_year; # print "2006"
my $nrf2 = DateTime::Fiscal::Nrf454->new( year => 2006, month = 1 );
print $nrf->nrf_year; # print "2005"
Returns a scalar containing the Fiscal Year that the object is in. This
is not always the same as the calendar year, especially for dates in
January and occasionally in Feburary. This is because the start of the
Fiscal Year is tied to what day of the week Jan 31 of any given year
falls on.
is_nrf_leap_year
my $nrf = DateTime::Fiscal::Nrf454->new( nrfyear => 2006 );
print "This is a Fiscal Leap Year" if $nrf->isa_nrf_leap_year;
Returns a Boolean value indicating whether or not the Fiscal Year for
the object has 53 weeks instead of the standard 52 weeks.
nrf_start
my $startdate = $nrf->nrf_start;
my $startobj = $nrf->nrf_start( as_obj => 1 );
Returns the starting date for the object's Fiscal Year as either a
string or an object as specified by the "as_obj" parameter (default is
string).
nrf_end
my $enddate = $nrf->nrf_end;
my $endobj = $nrf->nrf_end( as_obj => 1 );
Returns the ending date for the object's Fiscal Year as either a string
or an object as specified by the "as_obj" parameter (default is string).
nrf_period
# Return the current NRF period number
my $fp_number = $nrf->nrf_period;
# Return a list containing all data for the current period.
# The array is ( fp_number, fp_weeks, fp_start, fp_end, fp_year ).
my @fp_data = $nrf->nrf_period;
# As above but with objects for fp_start and fp_end instead of strings
my @fp_data = $nrf->nrf_period( as_obj => 1 );
# Specify the period for which data is returned.
my @fp_data = $nrf->nrf_period( period => 5 );
my @fp_data = $nrf->nrf_period( period => 5, as_obj => 1 );
This is the workhorse method and can be called in several ways.
When called in scalar context it defaults to returning a scalar
containing the current period number for the calling object.
When called in list context it returns a list containing all avaiable
data for a period.
A specific period may be requested by using the "period" parameter.
Objects instead of strings may be specified by the "as_obj" parameter.
The individual components for the number of weeks, starting date and
ending date may be obtained with the methods below if desired.
nrf_period_weeks
my $fp_weeks = $nrf->nrf_period_weeks;
my $fp_weeks = $nrf->nrf_period_weeks( period => 5 );
Returns a salar with the number of weeks in either the current or
specified period.
nrf_period_start
my $fp_start = $nrf->nrf_period_start;
my $fp_startobj = $nrf->nrf_period_start( as_obj => 1);
my $fp_start = $nrf->nrf_period_start( period => 5 );
my $fp_startobj = $nrf->nrf_period_start( as_obj => 1, period => 5 );
Returns either a string (default) or object representing the start of
the current (default) or specified period.
nrf_period_end
my $fp_end = $nrf->nrf_period_end;
my $fp_endobj = $nrf->nrf_period_end( as_obj => 1);
my $fp_end = $nrf->nrf_period_end( period => 5 );
my $fp_endobj = $nrf->nrf_period_end( as_obj => 1, period => 5 );
Returns either a string (default) or object representing the end of the
current (default) or specified period.
BUGS
You gotta be kidding!
SEE ALSO
DateTime
National Retailers Federation
(http://www.nrf.com/content/default.asp?folder=services&file=finance_454
.htm)
If you have a mailing list set up for your module, mention it here.
If you have a web site set up for your module, mention it here.
AUTHOR
Jim Bacon, <[EMAIL PROTECTED]>
COPYRIGHT AND LICENSE
Copyright (C) 2006 by Jim Bacon
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself, either Perl version 5.8.8 or, at
your option, any later version of Perl 5 you may have available.
_________________________________________________________________
MSN Shopping has everything on your holiday list. Get expert picks by style,
age, and price. Try it!
http://shopping.msn.com/content/shp/?ctId=8000,ptnrid=176,ptnrdata=200601&tcode=wlmtagline