Re: AnnualDataSummary PHP
Posted: Tue 20 Nov 2012 5:54 pm
Kiwi? That's good shoe polish!
Support forum for Cumulus weather station software
https://cumulus.hosiene.co.uk/
Just like most things from New Zealand!KevinF wrote:Kiwi? That's good shoe polish!
Indeed, Mr. B - I found the exchanges we had ... association now completes...BCJKiwi wrote:Ray, you know who I am as we have exchanged emails. Those are my real initials plus an indication of where in the world I am. I trust you know what a Kiwi is and where it comes from...
I used to enjoy the New Zealand lamb but now find it tasteless ... that is why I pay a bit more money and get my lamb from an island producer (ie: Vancouver Island, British Columbia, Canada)...BCJKiwi wrote:Just like most things from New Zealand!
Code: Select all
// was a year passed in the URL? If not use meterological date year from time stamp of dayfile.txt
if (isset($_GET['year'])) {
$tableYear=$_GET['year'];
} else {
if(date("m", filemtime($dayfile)) == 1 && date("d", filemtime($dayfile)) ==1) {
$tableYear = date("Y", filemtime($dayfile)) -1 ;
} else {
$tableYear = date("Y", filemtime($dayfile)) ;
}
}
It is relatively straightforward to either overide or declare a (new) class / style so that eg. the 2nd (right) column of the pair was left justified. The existing cell padding would leave a differential gap.However I would like to have the paired columns' data closer together than the non-paired columns and am not sure how complicated that would be to do. If it was relatively simple to identify and style differently alternate columns in the double column setup
I've posted in https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=6640 an update on year rollover - including a comparison of the PHP version you developed in this thread and the PHP version you've linked to from the Wiki. Could be a difference in our time zones issue or an error on my part, but one seemed on your 1 January to try to display 2013 before it was available, but all is right now its 2 January for you.BCJKiwi wrote:Back to the new year rollover - Oh dear not yet quite right.
BCJKiwi wrote:Back to the new year rollover - Oh dear not yet quite right.
We do need to -1 day.
Have looked in detail at what is on the hoster.
It is the 23/11/2012 here in NZ
The current file shows a last modified time stamp of of 23/11/2012 12:00:00 a.m.
Cumulus (well, Windows 7) shows the exact same time stamp.
The data is for the 22nd.
The best solution I could come up with that should work regardless of the rollover time is :-i.e. if the mod date of the file is the first day of the year use the previous year.Code: Select all
// was a year passed in the URL? If not use meterological date year from time stamp of dayfile.txt if (isset($_GET['year'])) { $tableYear=$_GET['year']; } else { if(date("m", filemtime($dayfile)) == 1 && date("d", filemtime($dayfile)) ==1) { $tableYear = date("Y", filemtime($dayfile)) -1 ; } else { $tableYear = date("Y", filemtime($dayfile)) ; } }