Skip to content

Commit

Permalink
Reintroducing 12hr clock fix....
Browse files Browse the repository at this point in the history
The fix for a 12hr clock git taken out somehow, adding that fix back in.
Fixing the permissions on a couple files
  • Loading branch information
lightmaster committed May 20, 2019
1 parent b4f9abc commit 72d6385
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 1 deletion.
Empty file modified barometeralmanac.php 100755 → 100644
Empty file.
Empty file modified easyweathersetup.php 100755 → 100644
Empty file.
Empty file modified forecast3wu.php 100755 → 100644
Empty file.
Empty file modified forecast3wularge.php 100755 → 100644
Empty file.
Empty file modified mooninfo.php 100755 → 100644
Empty file.
Empty file modified moonphase.php 100755 → 100644
Empty file.
39 changes: 38 additions & 1 deletion updater.php 100755 → 100644
Expand Up @@ -62,4 +62,41 @@
var refreshId;$(document).ready(function(){currentfore()});function currentfore(){$.ajax({cache:false,success:function(a){$("#currentfore").html(a);setTimeout(currentfore,360000)},type:"GET",url:"<?php echo $position6?>"})};</script>
<?php if ($position1=="weather34clock.php"){?>
<script>
var clockID;var yourTimeZoneFrom=<?php echo $UTC?>;var d=new Date();var weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var tzDifference=yourTimeZoneFrom*60+d.getTimezoneOffset();var offset=tzDifference*60*1000;function UpdateClock(){var e=new Date(new Date().getTime()+offset);var c=e.getHours()<?php echo $clockformat2?>;var a=e.getMinutes();var g=e.getSeconds();var f=e.getFullYear();var h=months[e.getMonth()];var b=e.getDate();var i=weekdays[e.getDay()];if(a<10){a="0"+a}if(g<10){g="0"+g}if(c<10){c="0"+c}document.getElementById("theTime").innerHTML="<div class='weatherclock34'> "+i+" "+b+" "+h+" "+f+"<div class='orangeclock'>"+c+":"+a+":"+g}function StartClock(){clockID=setInterval(UpdateClock,500)}function KillClock(){clearTimeout(clockID)}window.onload=function(){StartClock()};</script><?php }?>
var clockID;
var yourTimeZoneFrom=<?php echo $UTC?>;
var d=new Date();
var weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
var tzDifference=yourTimeZoneFrom*60+d.getTimezoneOffset();
var offset=tzDifference*60*1000;
function UpdateClock(){
var e=new Date(new Date().getTime()+offset);
var c=e.getHours()<?php if ($clockformat == '12') { echo '% 12 || 12';} else { echo '% 24 || 24';}?>;
<?php
if($clockformat=='12') {
echo "if(e.getHours()<12){amorpm=' am'}else{amorpm=' pm'}";
} else {
echo "amorpm='';";
}
?>
var a=e.getMinutes();
var g=e.getSeconds();
var f=e.getFullYear();
var h=months[e.getMonth()];
var b=e.getDate();
var i=weekdays[e.getDay()];
if(a<10){
a="0"+a
}
if(g<10){
g="0"+g
}
if(c<10){
c="0"+c
}
document.getElementById("theTime").innerHTML="<div class='weatherclock34'> "+i+" "+b+" "+h+" "+f+"<div class='orangeclock'>"+c+":"+a+":"+g+amorpm
}
function StartClock(){clockID=setInterval(UpdateClock,500)}
function KillClock(){clearTimeout(clockID)}
window.onload=function(){StartClock()};
</script><?php }?>

1 comment on commit 72d6385

@lightmaster
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes Issue #30 again.

Please sign in to comment.