diff options
| author | horus | 2020-09-19 20:28:21 +0200 |
|---|---|---|
| committer | horus | 2020-09-19 20:28:21 +0200 |
| commit | cb55dd29e1721b5a1df0a5b9aca06171d7ae56c3 (patch) | |
| tree | 2146f42458f711c41df421772f1ff7d6b47cd43c /app/helpers.php | |
| parent | fa1a8ffcb25522edea08874afbd7f3bbc6e1f733 (diff) | |
| download | senpai-cb55dd29e1721b5a1df0a5b9aca06171d7ae56c3.tar.gz | |
remove hard coded season order
Diffstat (limited to 'app/helpers.php')
| -rw-r--r-- | app/helpers.php | 15 |
1 files changed, 14 insertions, 1 deletions
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('\%', '\_'); |
