[dw-nonfree] December paid time promotion
[commit: http://hg.dwscoalition.org/dw-nonfree/rev/aea5ec0c72a4]
http://bugs.dwscoalition.org/show_bug.cgi?id=3993
Update time when the promo should run. Input now in human-readable date; let
the computer convert it to a timestamp!
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3993
Update time when the promo should run. Input now in human-readable date; let
the computer convert it to a timestamp!
Patch by
Files modified:
- cgi-bin/DW/Hooks/AnniversaryPromotion.pm
--------------------------------------------------------------------------------
diff -r 6e4f8ff01d88 -r aea5ec0c72a4 cgi-bin/DW/Hooks/AnniversaryPromotion.pm
--- a/cgi-bin/DW/Hooks/AnniversaryPromotion.pm Wed Nov 16 19:32:03 2011 +0800
+++ b/cgi-bin/DW/Hooks/AnniversaryPromotion.pm Wed Nov 23 11:30:41 2011 +0800
@@ -18,11 +18,15 @@
use strict;
use LJ::Hooks;
+# use mysql date format: year-month-date hour::min:seconds
+my $start_time = LJ::mysqldate_to_time( "2011-12-01 00:00:00", 1 );
+my $end_time = LJ::mysqldate_to_time( "2011-12-31 23:59:59", 1 );
+# warn sprintf( "Running shop promo from %s to %s\n", scalar gmtime( $START_TIME ), scalar gmtime( $END_TIME ) );
+
# returns if the promotion is valid right now
sub promo_valid {
- # valid from Wed Dec 1 00:00:00 2010 UTC to Fri Dec 31 23:59:59 2010 UTC
- return 0 if time < 1291161600 || time > 1293839999;
+ return 0 if time < $start_time|| time > $end_time;
return 1;
}
--------------------------------------------------------------------------------

no subject
Error loading DW::Controller::Legal: Error loading DW::Hooks::AnniversaryPromotion: Undefined subroutine &LJ::mysqldate_to_time called at /dreamhack/home/8174-ninetydegrees/dw/cgi-bin/DW/Hooks/AnniversaryPromotion.pm line 22.
no subject
no subject