From cb55dd29e1721b5a1df0a5b9aca06171d7ae56c3 Mon Sep 17 00:00:00 2001 From: horus Date: Sat, 19 Sep 2020 20:28:21 +0200 Subject: remove hard coded season order --- app/helpers.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'app/helpers.php') diff --git a/app/helpers.php b/app/helpers.php index 4c946f7..c96b972 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -70,7 +70,7 @@ function getAiringStatusCode($airing_status) { function getSeason( $month = null ){ if ( is_null($month) ) { - $month = date("m"); + $month = (int)date("m"); } switch( $month ) { case 1: @@ -88,6 +88,19 @@ function getSeason( $month = null ){ } } +function nextSeason( $month = null ){ + if ( is_null($month) ) { + $month = (int)date("m"); + } + + $next = $month + 3; + if ( $next > 12 ) { + $next = $next - 12; + } + + return $next; +} + function escapeLike($string){ $search = array('%', '_'); $replace = array('\%', '\_'); -- cgit v1.2.3