Page 1 of 1

Since it last rained in D/M/H no longer working

Posted: Wed 27 Aug 2014 12:49 am
by ace2
Up until i converted my pages to be HTML5 compliant, this thing worked fine, it displays days, hours and minutes since it last rained.

Code: Select all

Since it last Rained&nbsp:<script type="text/javascript">
(function(){
  var days = Math.floor(<#MinutesSinceLastRainTip>/24/60);
  var hrs = Math.floor(<#MinutesSinceLastRainTip>/60%24);
  var mins = Math.floor(<#MinutesSinceLastRainTip>%60);
  function plur(x){return x === 1 ? '' : 's'};
  document.write(days + ' Day' + plur(days) + ' : ' + hrs + ' Hr' + plur(hrs) + ' : ' + mins + ' Min' + plur(mins));
}());
</script>
But now is displays the same figure, never changes. I don't know why...
The site page http://www.users.on.net/~ace2/index.htm
the template in use http://www.users.on.net/~ace2/indexT.htm

I've tried removing all the other Java scripts in this template with no success.....

Re: Since it last rained in D/M/H no longer working

Posted: Wed 27 Aug 2014 3:15 am
by beteljuice
That's because your Template does NOT have <#MinutesSinceLastRainTip> but a hard coded value of 937 ;)

Re: Since it last rained in D/M/H no longer working

Posted: Wed 27 Aug 2014 3:52 am
by ace2
beteljuice wrote:That's because your Template does NOT have <#MinutesSinceLastRainTip> but a hard coded value of 937 ;)
God i'm an idiot.... :groan:

I was staring at it as well!!!


**hides under rock** :bash: