diff --git a/lib/Constants.php b/lib/Constants.php index 0b7a8c0a..b37373ad 100644 --- a/lib/Constants.php +++ b/lib/Constants.php @@ -1,9 +1,10 @@ format('Y')) - 96); // Latest continental US time zone. +define('PD_YEAR', intval((new DateTimeImmutable('now', LATEST_CONTINENTAL_US_TZ))->format('Y')) - 96); define('PD_STRING', 'January 1, ' . (PD_YEAR + 1)); // Controls the progress bar donation dialog. @@ -100,8 +101,8 @@ const DONATION_DRIVE_DATES = [ // Controls the countdown donation dialog, basically unused right now. const DONATION_DRIVE_COUNTER_ENABLED = false; -const DONATION_DRIVE_COUNTER_START = new DateTimeImmutable('May 2, 2022 00:00:00 America/New_York'); -const DONATION_DRIVE_COUNTER_END = new DateTimeImmutable('May 8, 2022 23:59:00 America/New_York'); +const DONATION_DRIVE_COUNTER_START = new DateTimeImmutable('May 2, 2022 00:00:00', new DateTimeZone('America/New_York')); +const DONATION_DRIVE_COUNTER_END = new DateTimeImmutable('May 8, 2022 23:59:00', new DateTimeZone('America/New_York')); const PD_DAY_YEAR = 2025; const PD_DAY_DRAFT_PATH = '/standardebooks.org/drafts/' . PD_DAY_YEAR; diff --git a/lib/Enums/ColorSchemeType.php b/lib/Enums/ColorSchemeType.php new file mode 100644 index 00000000..d5dc260f --- /dev/null +++ b/lib/Enums/ColorSchemeType.php @@ -0,0 +1,8 @@ + DONATION_DRIVE_COUNTER_END){ +if(!DONATION_DRIVE_COUNTER_ENABLED || ($autoHide ?? (HttpInput::Bool(COOKIE, 'hide-donation-alert') ?? false)) || NOW > DONATION_DRIVE_COUNTER_END){ return; } @@ -42,6 +42,7 @@ $digits = str_split(str_pad((string)$current, 3, "0", STR_PAD_LEFT))