Standarized how expiry and stamp periods are used
This commit is contained in:
1 parent
d105c55469
commit
37eab1fba0
4 files changed
+72
-44
No files matched your search
+30
-2
@@ -1571,8 +1571,36 @@ function strip_nl($string) {
|
||||
|
||||
function getStickerPeriod($time)
|
||||
{
|
||||
$start = date('Y', strtotime($time));
|
||||
return $start . '/' . (substr($start,2,2) + 1);
|
||||
$time = is_numeric($time)?$time:strtotime($time);
|
||||
|
||||
if($time < strtotime('2011-08-01'))
|
||||
return date('Y', $time); //gammelt klistremerke
|
||||
|
||||
$year = date('Y', $time);
|
||||
return ($year - 1) . '/' . substr($year, 2);
|
||||
}
|
||||
|
||||
function getNextMembershipExpiryDate()
|
||||
{
|
||||
return getExpiryDate();
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the next 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';
|
||||
}
|
||||
}
|
||||
|
||||
// Migration (nikolark)
|
||||
|
||||
Reference in new issue
Block a user