<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">=head1 DateTimeX::Mashup::Shiras

A Moose role with four date attributes

=head1 SYNOPSIS
    
	package MyPackage;
	use Moose;
	use MooseX::HasDefaults::RO;
	with 'DateTimeX::Mashup::Shiras';
	no Moose;
	__PACKAGE__-&gt;meta-&gt;make_immutable;

	#!perl
	my  $firstinst = MyPackage-&gt;new( 
			'date_one' =&gt; '8/26/00',
		);
	print $firstinst-&gt;get_date_one-&gt;format_cldr( "yyyy-MMMM-d" ) . "\n";
	print $firstinst-&gt;get_date_one_wkend-&gt;ymd( '' ) . "\n";
	print $firstinst-&gt;get_date_one_wkstart-&gt;ymd( '' ) . "\n";
	print $firstinst-&gt;set_date_three( '11-September-2001' ) . "\n";
	print $firstinst-&gt;get_date_three_wkstart-&gt;dmy( '' ) . "\n";
	print $firstinst-&gt;set_date_one( -1299767400 ) . "\n";
	print $firstinst-&gt;set_date_one( 36764.54167 ) . "\n";
	print $firstinst-&gt;set_date_one( 0 ) . "\n";
    
	#######################################
	#     Output of SYNOPSIS
	# 01:2000-August-26
	# 02:20000901
	# 03:20000826
	# 04:2001-09-11T00:00:00
	# 05:08092001
	# 06:1928-10-26T09:30:00
	# 07:2000-08-26T13:00:00
	# 09:1970-01-01T00:00:00
	#######################################
    
=head1 DESCRIPTION

L&lt;Shiras|http://en.wikipedia.org/wiki/Moose#Subspecies&gt; - A small subspecies of 
Moose found in the western United States.

This is a Moose L&lt;Role|https://metacpan.org/module/Moose::Manual::Roles&gt; that 
has four flexible date attributes and some additional date functionality.  This 
role can add some date attributes to your class with built in date handling.  It 
also provides the traditional today, now, and weekend date calculation for a given 
day.

The flexibility of input for the dates comes from three different DateTime::Format 
packages using type coersion.  The three modules are; L&lt;DateTime::Format::Flexible
|https://metacpan.org/module/DateTime::Format::Flexible&gt;, 
L&lt;DateTime::Format::Epoch|https://metacpan.org/module/DateTime::Format::Epoch&gt;, 
and L&lt;DateTime::Format::Excel|https://metacpan.org/module/DateTime::Format::Excel&gt;.  
The choice between them is managed by L&lt;DateTimeX::Mashup::Shiras::Types
|https://metacpan.org/module/DateTimeX::Mashup::Shiras::Types&gt; as a type coersion.  
This means that all input strings are parsed by ::Format::Flexible.  All numbers 
are parsed either by ::Format::Excel or ::Format::Epoch.  See the type package 
for the details and corner cases.  Since all the succesful date 'getters' 
return DateTime objects, all the L&lt;DateTime|https://metacpan.org/module/DateTime&gt; 
methods can be applied directly.  ex. $inst-&gt;get_today_wkend-&gt;ymd( "/" ). 

=head2 Attributes

Attributes listed here can be passed to -E&lt;gt&gt;new as listed below.

=head3 (date_one|date_two|date_three|date_four)

=over

B&lt;Definition:&gt; these are date attributes set to the type 'datetimedate'.  
See the L&lt;Type|https://metacpan.org/module/DateTimeX::Mashup::Shiras::Types&gt; 
Class for more details.

B&lt;Default&gt; empty

B&lt;Range&gt; Currently input of Time Zones is L&lt;not supported|/TODO&gt;.

=back

=head3 week_end

=over

B&lt;Definition:&gt; This holds the definition of the last day of the week

B&lt;Default&gt; 'Friday'

B&lt;Range&gt; This will accept either day names, day abbreviations 
(no periods), or day integers (1 = Monday, 7 = Sunday )

=back

=head2 Methods

Methods are used to manipulate both the public and private attributes of this role.  
All attributes are set as 'ro' so other than -&gt;new(  ) these methods are the only way 
to change or clear attributes.  See L&lt;Moose::Manual::Roles
|https://metacpan.org/module/Moose::Manual::Roles&gt; for generic implementation 
instructions.

=head3 set_(date_one|date_two|date_three|date_four)( $date )

=over

B&lt;Definition:&gt; This is the way to change (or set) the various dates.  

B&lt;Accepts:&gt; Any $date data that can be coerced by L&lt;supported ::Format
|/DESCRIPTION&gt; modules.

B&lt;Returns:&gt; the equivalent DateTime object

=back

=head3 get_(date_one|date_two|date_three|date_four|today|)-&gt;format_command( 'format' )

=over

B&lt;Definition:&gt; This is how you can call various dates and format their 
output.  example $self-&gt;get_date_two-&gt;ymd( "-" ).  For this example 
the date_two attribute had been previously set.  B&lt;Note:&gt; 'today' and 'now' 
are special attribute cases and do not need to be defined to be retrieved.

B&lt;Returns:&gt; a DateTime object

=back

=head3 get_$attribute_name_(wkend|wkstart)

=over

B&lt;Definition:&gt; This is a way to call the equivalent start and end of the 
week definded by the given 'week_end' attribute value.  All dates listed above 
including 'today' except 'now' can be substitued for $attributename.

B&lt;Returns:&gt; a DateTime object

=back

=head1 SUPPORT

L&lt;github DateTimeX-Mashup-Shiras/issues|https://github.com/jandrew/DateTimeX-Mashup-Shiras/issues&gt;

=head1 TODO

=over

B&lt;1.&gt; Support Timezone input and changes

B&lt;2.&gt; Support custom epoch input and changes

B&lt;3.&gt; Add L&lt;Log::Shiras|https://github.com/jandrew/Log-Shiras&gt; debugging in exchange for
L&lt;Smart::Comments|https://metacpan.org/module/Smart::Comments&gt;

=over

* Get Log::Shiras CPAN ready first

=back

=back

=head1 AUTHOR

=over

=item Jed Lund

=item jandrew@cpan.org

=back

=head1 COPYRIGHT

This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the
LICENSE file included with this module.

This software is copyrighted (c) 2013 by Jed Lund.

=head1 DEPENDENCIES

=over

L&lt;version|https://metacpan.org/module/version&gt;

L&lt;Moose::Role|https://metacpan.org/module/Moose::Role&gt;

L&lt;MooseX::Types::Moose|https://metacpan.org/module/MooseX::Types::Moose&gt;

L&lt;DateTimeX::Mashup::Shiras::Types|https://metacpan.org/module/DateTimeX::Mashup::Shiras::Types&gt;

=over

B&lt;includes depenencies&gt;

=over

L&lt;DateTime|https://metacpan.org/module/DateTime&gt;

L&lt;DateTime::Format::Epoch|https://metacpan.org/module/DateTime::Format::Epoch&gt;

L&lt;DateTime::Format::Excel|https://metacpan.org/module/DateTime::Format::Excel&gt;

L&lt;DateTime::Format::Flexible|https://metacpan.org/module/DateTime::Format::Flexible&gt;

=back

=back

=back

=head1 SEE ALSO

=over

L&lt;Time::Piece|https://metacpan.org/module/Time::Piece&gt;

L&lt;MooseX::Types::Perl|https://metacpan.org/module/MooseX::Types::Perl&gt;

L&lt;Date::Parse|https://metacpan.org/module/Date::Parse&gt;

L&lt;Date::Manip::Date|https://metacpan.org/module/Date::Manip::Date&gt;

L&lt;DateTimeX::Format|https://metacpan.org/module/DateTimeX::Format&gt;

=back

=cut

=head1 Build from Source - (for example git)
	
Download a compressed file with the code
	
Extract the code from the compressed file

Change into the extracted directory

(For Windows find what version of make was used to compile your perl)

	perl  -V:make

Then

	&gt;perl Makefile.PL

	&gt;make

	&gt;make test

	&gt;make install

	&gt;make clean
	(use the windows make version as appropriate (dmake?))</pre></body></html>