fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-11-23 03:28 am

[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 [personal profile] fu.

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;
 }
 
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org