use warnings;
use Carp;
use C4::Context;
+use C4::Debug;
use Exporter;
use POSIX qw(strftime);
use Date::Calc qw(check_date check_time);
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($debug $cgi_debug);
BEGIN {
$VERSION = 0.03;
}
my $prefformat = C4::Context->preference('dateformat');
-my $debug = $ENV{'DEBUG'} || 0;
+# print STDERR " Dates : \$debug is '$debug'\n";
+# print STDERR " Dates : \$cgi_debug is '$cgi_debug'\n";
our %format_map = (
iso => 'yyyy-mm-dd',
return @{$aref};
}
# $debug and
- carp "Illegal Date '$val' does not match '$dformat' format: " . $self->visual() . "\n";
+ carp "Illegal Date '$val' does not match '$dformat' format: " . $self->visual();
return 0;
}
my $chron_ref = shift;
my ($year, $month, $day) = _chron_to_ymd($chron_ref);
unless (check_date($year, $month, $day)) {
- carp "Illegal date specified (year = $year, month = $month, day = $day)\n";
+ carp "Illegal date specified (year = $year, month = $month, day = $day)";
}
my ($hour, $minute, $second) = _chron_to_hms($chron_ref);
unless (check_time($hour, $minute, $second)) {
- carp "Illegal time specified (hour = $hour, minute = $minute, second = $second)\n";
+ carp "Illegal time specified (hour = $hour, minute = $minute, second = $second)";
}
}