slackget10::Date is a Perl class to manage date for slack-get.
This class is an abstraction of a date. It centralyze all operation you can do on a date (like comparisons)
my $date = slackget10::Date->new('day-name' => Mon, 'day-number' => 5, 'year' => 2005);
my $status = $date->compare($another_date_object);
print "Nothing to do : date are the samen";
The constructor take the followings arguments :
day-name => the day name in : Mon, Tue, Wed, Thu, Fri, Sat, Sun
day-number => the day number from 1 to 31. WARNINGS : there is no verification about the date validity !
month-name => the month name (Jan, Feb, Apr, etc.)
month-number => the month number (1 to 12)
hour => the hour ( a string like : 12:52:00). The separator MUST BE ':'
year => a chicken name...no it's a joke the year (ex: 2005).
use-approximation => in this case the comparisons method just compare the followings : day, month and year. (default: no)
You have to manage by yourself the date validity, because this class doesn't check the date validity. The main reason of this, is that this class is use to compare the date of specials files.
So I use the predicate that peoples which make thoses files don't try to do a joke by a false date.
my $date = slackget10::Date->new(
'day-name' => Mon,
'day-number' => 5,
'year' => 2005,
'month-number' => 2,
'hour' => '12:02:35',
'use-approximation' => undef