Ticket #41 - innreport creates incorrect file names at the start of the year
Alexander Bartolich
alexander.bartolich at gmx.at
Mon Jan 19 20:30:42 UTC 2009
Julien ÉLIE wrote:
> [...]
>> + # Innreport assumes that it is running in the same year the log
>> + # file was written. This has just been proven false. All dates
>> + # processed up to now are from last year, not current year. Leap
>> + # year calculation for them was wrong. There is no easy way to
>> + # correct this.
>> + #
>> + # However, we can simply assume that dates before 1st of May
>> + # belong to current year. With this definition it is not possible
>> + # to cross from both 31st of December to 1st of January and from
>> + # 28th of February to 1st of March in the same log file.
>> + #
>> + # Note: $month_to_dayofyear[12] - $month_to_dayofyear[4] = 245
>
> I do not understand well the comment. A file which contains information
> from December, 25th to April, 9th works fine for me.
> But not November, 25th to April, 9th. What is May, 1st for?
The comment is confusing, indeed. What I meant to say is that you cannot
have a log going from 28th of February to 1st of January. 25th of November
to 9th of April should work fine, though. What problems did you encounter?
I chose 1st of May to have some value in the vicinity of 253 that is
easy to remember.
Perhaps it would be better to correct function DateCompare instead, where
this 253 comes from. The distance between 1st of March to 31th of December
is 307. Maybe the code in DateCompare (which uses 300 days but in a year of
432 days) tried to check a short distance from the bissextile day.
> [...]
> At line 505, there is "}" which should be removed.
Oh, sorry.
> (I trusted your indentation to do that.)
> Or should have it been removed at line 522?
No, the changes you committed are fine.
Ciao
Alexander.
More information about the inn-workers
mailing list