From a46bf12768e61fa416bbc779bcb081b5f29b555b Mon Sep 17 00:00:00 2001 From: ahmedre Date: Thu, 12 May 2011 17:36:28 +0200 Subject: [PATCH] fix problem when no dst rule falling back to geonames to fix egypt issue. --- calculate.php | 3 --- index.php | 1 - prayertimes.inc | 11 ++++++++--- 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 calculate.php diff --git a/calculate.php b/calculate.php deleted file mode 100644 index 6121e3e..0000000 --- a/calculate.php +++ /dev/null @@ -1,3 +0,0 @@ -= $max) throw new Exception('date exception'); - if (!isset($transitions[$i+1])) - throw new Exception('date exception'); + + // means we reach the end with no applicable switch rule. + // in this case, use the cur offset and assume no dst. + if (!isset($transitions[$i+1])){ + $dst = 0; + $gmt_offset = $cur_offset; + break; + } if (($now >= $transitions[$i]['ts']) && ($now < $transitions[$i+1]['ts'])){