Brick - This is the description
use Brick;
| sub _is_in_the_future | |
| { | |
| my( $bucket, $setup ) = @_; | |
| croak "Not implemented"; | |
| } |
| sub _is_tomorrow | |
| { | |
| my( $bucket, $setup ) = @_; | |
| croak "Not implemented"; | |
| } |
| sub _is_today | |
| { | |
| my( $bucket, $setup ) = @_; | |
| croak "Not implemented"; | |
| } |
| sub _is_yesterday | |
| { | |
| my( $bucket, $setup ) = @_; | |
| croak "Not implemented"; | |
| } |
| sub _is_in_the_past | |
| { | |
| my( $bucket, $setup ) = @_; | |
| croak "Not implemented"; | |
| } |
I can specify any of the dates as part of the setup by supplying them as the values for these keys in the setup hash:
start_date
end_date
input_date
Instead of fixed values, I can tell the function to get values from input fields. Put the field names in the values for these keys of the setup hash"
start_date_field
end_date_field
input_date_field
I can use any combination of these setup fields, although the start_date, end_date, and input_date take precedence.
TO DO: Need to validate all the date formats before I use them in the comparisons
I can specify any of the dates as part of the setup by supplying them as the values for these keys in the setup hash:
start_date
end_date
input_date
Instead of fixed values, I can tell the function to get values from input fields. Put the field names in the values for these keys of the setup hash"
start_date_field
end_date_field
input_date_field
I can use any combination of these setup fields, although the start_date, end_date, and input_date take precedence.
TO DO: Need to validate all the date formats before I use them in the comparisons
Like at_least_N_days_between, but the dates cannot be more than N days
apart.
At the moment this has the curious result that if the end date in before the start date, the duration between them is negative, so that duration is shorter than any positive number. This isn't a bug but a loack of a design decision if I should require the end date to be after the start date.
| sub at_most_N_days_after | |
| { | |
| my( $bucket, $setup ) = @_; |
croak "Not implemented!";
}
| sub at_most_N_days_before | |
| { | |
| my( $bucket, $setup ) = @_; |
croak "Not implemented!";
}
| sub before_fixed_date | |
| { | |
| my( $bucket, $setup ) = @_; |
croak "Not implemented!";
}
| sub after_fixed_date | |
| { | |
| my( $bucket, $setup ) = @_; |
croak "Not implemented!";
}
Given two dates in YYYYMMDD format, return the number of days between them, including the last date.
For the dates 20070101 and 20070103, return 2 because it includes the last day.
For the dates 20070101 and 20060101, return -365 because the last date is in the past.
Given a date in YYYYMMDD format, return an anonymous hash with the keys:
year
month
day
TBA
TBA
This source is part of a SourceForge project which always has the latest sources in CVS, as well as all of the previous releases.
http://sourceforge.net/projects/brian-d-foy/
If, for some reason, I disappear from the world, one of the other members of the project can shepherd this module appropriately.
brian d foy, <bdfoy@cpan.org>
Copyright (c) 2007, brian d foy, All Rights Reserved.
You may redistribute this under the same terms as Perl itself.