From ec4e3b6b347e009a966df9f6667f7676e5a7c377 Mon Sep 17 00:00:00 2001 From: Nikolai Kristiansen Date: Wed, 27 Aug 2014 23:34:56 +0200 Subject: [PATCH] Next expiry is allways 1 year from given time, not the nearest august 1. --- inside/functions.php | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/inside/functions.php b/inside/functions.php index e5ed5f1..e8b3651 100644 --- a/inside/functions.php +++ b/inside/functions.php @@ -1583,21 +1583,15 @@ function getNextMembershipExpiryDate() } /* - * Returns the next expiry date for a given time. + * Returns the expiry date for a given time. */ -function getExpiryDate($time = null) -{ - if($time == null) $time = time(); - $time = is_numeric($time)?$time:strtotime($time); - - if (date("m-d", $time) > "08-01" ) - { - return date("Y", strtotime("+1 year", $time)) . '-08-01'; - } - else - { - return date("Y", $time) . '-08-01'; - } +function getExpiryDate($time = null) { + if($time == null) { + $time = time(); + } + $time = is_numeric($time) ? $time : strtotime($time); + + return date("Y-m-d", strtotime("+1 year", $time)); } // Migration (nikolark)