summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrhimport-sm12
-rwxr-xr-xrhimport-ut2
2 files changed, 7 insertions, 7 deletions
diff --git a/rhimport-sm b/rhimport-sm
index bbddbe5..12ed8e2 100755
--- a/rhimport-sm
+++ b/rhimport-sm
@@ -84,8 +84,8 @@ if($curweek < 1 || $curweek > 4) {
my @today = Date::Calc::Today();
my $dow = Date::Calc::Day_of_Week(@today);
-if(($curweek != 1 && $curweek != 4) ||
- ($curweek == 1 && $dow > 3) ||
+if(($curweek != 1 && $curweek != 4) ||
+ ($curweek == 1 && $dow > 3) ||
($curweek == 4 && $dow <= 3)) {
print "File won't be available by now!\n";
$dbh->disconnect();
@@ -95,7 +95,7 @@ print "today: " . Date::Calc::Date_to_Text(@today) . "\n";
my @import_date = Date::Calc::Standard_to_Business(@today);
$import_date[2] = 3;
-@import_date = Date::Calc::Business_to_Standard($import_date[0], $import_date[1], $import_date[2]);
+@import_date = Date::Calc::Business_to_Standard(@import_date);
if($curweek == 4) {
@import_date = Date::Calc::Add_Delta_Days(@import_date, 7);
}
@@ -114,9 +114,9 @@ if(Date::Calc::Delta_Days(@broadcast_date, @today) <= 0) {
exit 0;
}
-my $id = sprintf("%04d-%02d-%02d", $import_date[0], $import_date[1], $import_date[2]);
-my $bd = sprintf("%04d-%02d-%02d", $broadcast_date[0], $broadcast_date[1], $broadcast_date[2]);
-my $bdfile = sprintf("%04d-?%02d-?%02d", $broadcast_date[0], $broadcast_date[1], $broadcast_date[2]);
+my $id = sprintf("%04d-%02d-%02d", @import_date);
+my $bd = sprintf("%04d-%02d-%02d", @broadcast_date);
+my $bdfile = sprintf("%04d-?%02d-?%02d", @broadcast_date);
print "looking for files from $bd in RSS Feed\n";
print " -> $RSS_URL\n";
diff --git a/rhimport-ut b/rhimport-ut
index 17f92d2..1403246 100755
--- a/rhimport-ut
+++ b/rhimport-ut
@@ -73,7 +73,7 @@ my $to_cart = $allowed_dbs[$idx]->{'TO_CART'};
my $dropbox_reb = $allowed_dbs[$idx_reb]->{'PATH'};
my $to_cart_reb = $allowed_dbs[$idx_reb]->{'TO_CART'};
-my @import_date = Date::Calc::Standard_to_Business((2013, 12, 30)); # Date::Calc::Today());
+my @import_date = Date::Calc::Standard_to_Business(Date::Calc::Today());
my $dow = $import_date[2];
$import_date[2] = 3;
@import_date = Date::Calc::Business_to_Standard(@import_date);