Page 1 of 1

Meteogram time

Posted: Sat Jan 06, 2018 6:24 pm
by danville
The meteorgram (block) time is ahead by 7 hours and I have made certain that all setup time information is correct. What might need to be done to correct this?

Re: Meteogram time

Posted: Sat Jan 06, 2018 6:43 pm
by Gus
Open /homepage/blocks/meteogram/meteogramBlock.php and go to around line 80 and replace the global settings with...
<script>
Highcharts.setOptions({ // Fix for forecast timeline
global: { // useUTC: true is the default setting and graph is x hrs off,
useUTC: false, // change to false and add timezoneOffset : echo($offset * -60)
timezoneOffset: <?php echo $offset*-60?> // value of $offset is calculated in config.php, *-60 to change east-west designation
},
This seems to correct the UTC/ local time problem.
Gus

Re: Meteogram time

Posted: Sun Jan 07, 2018 4:27 am
by Ken Good
I am having the same issue. I tried to make the changes suggested and keep getting error messages. Is this the language:

<script>
Highcharts.setOptions({
global: {
useUTC: true
},
lang: {
months: ['<?php echo lang('january','c')?>', '<?php echo lang('february','c')?>', '<?php echo lang('march','c')?>', '<?php echo lang('april','c')?>', '<?php echo lang('may','c')?>', '<?php echo lang('june','c')?>', '<?php echo lang('july','c')?>', '<?php echo lang('august','c')?>', '<?php echo lang('september','c')?>', '<?php echo lang('october','c')?>', '<?php echo lang('november','c')?>', '<?php echo lang('december','c')?>'],
shortMonths: ['<?php echo lang('janAbbr','c')?>', '<?php echo lang('febAbbr','c')?>', '<?php echo lang('marAbbr','c')?>', '<?php echo lang('aprAbbr','c')?>', '<?php echo lang('mayAbbr','c')?>', '<?php echo lang('junAbbr','c')?>', '<?php echo lang('julAbbr','c')?>', '<?php echo lang('augAbbr','c')?>', '<?php echo lang('sepAbbr','c')?>', '<?php echo lang('octAbbr','c')?>', '<?php echo lang('novAbbr','c')?>', '<?php echo lang('decAbbr','c')?>'],
weekdays: ['<?php echo lang('sundayAbbr','c')?>', '<?php echo lang('mondayAbbr','c')?>', '<?php echo lang('tuesdayAbbr','c')?>', '<?php echo lang('wednesdayAbbr','c')?>', '<?php echo lang('thursdayAbbr','c')?>', '<?php echo lang('fridayAbbr','c')?>', '<?php echo lang('saturdayAbbr','c')?>'],
resetZoom: ['<?php echo lang('default zoom','c')?>']
}
});
</script>

I am UTC -6. How should this be changed?
Thanks in advance.

Re: Meteogram time

Posted: Sun Jan 07, 2018 3:24 pm
by Gus
That is the correct area. Replace...
global: {
useUTC: true
},

with...

global: {
useUTC: false,
timezoneOffset: <?php echo $offset*-60?>
},

See if that works. Also remember to clear the cache files after making change.
Gus

Re: Meteogram time

Posted: Sun Jan 07, 2018 7:03 pm
by Ken Good
Thanks that worked. I was all around it but did not know the programing language. My shots in the dark all fell flat. Thanks again.

Ken

Re: Meteogram time

Posted: Sun Jan 07, 2018 7:25 pm
by Jachym
Thanks Gus, you are right, I will update the block for everyone