summaryrefslogtreecommitdiff
path: root/app/helpers.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers.php')
-rw-r--r--app/helpers.php15
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('\%', '\_');