Skip to content

Commit

Permalink
fix problem when no dst rule falling back to geonames to fix egypt is…
Browse files Browse the repository at this point in the history
…sue.
  • Loading branch information
ahmedre committed May 12, 2011
1 parent 3d1e6e4 commit a46bf12
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 0 additions & 3 deletions calculate.php

This file was deleted.

1 change: 0 additions & 1 deletion index.php
Expand Up @@ -4,7 +4,6 @@
return;
}

// $ajax is set automagically from calculate.php for legacy purposes
// $_GET['ajax'] should be set by the javascript in an ajax call.
$ajax = isset($ajax)? true : (isset($_GET['ajax'])? true : false);
$format = (isset($_GET['rss'])? 'rss' :
Expand Down
11 changes: 8 additions & 3 deletions prayertimes.inc
Expand Up @@ -113,9 +113,14 @@ class PrayerTimes {
while (true){
// i make no guarantees about this code after october 2037.
// if it gets to that point, fallback to geonames.
if ($i >= $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'])){
Expand Down

0 comments on commit a46bf12

Please sign in to comment.