- Feature Articles
- CodeSOD
-
Error'd
- Most Recent Articles
- Retry Fail
- Office Politics
- Secret Horror
- Not Impossible
- Monkeys
- Killing Time
- Hypersensitive
- Infallabella
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Edit Admin
If we wish to be pedantic about "for completeness", the options should also include Fail.
Edit Admin
The Facebook problem is clearly wrong, Der Dritte Raum (The third room, translated from German) requires all menu items to appear three times, not just two.
Admin
the date problem is simple they divide the difference by millis/year and
(Date.parse("2025-01-26") - Date.parse("2018-01-28")) / 31536000000
returns 7Admin
How hard is it to uze floating-point arithmetic for that?
Edit Admin
More to the point, how hard is it to use a better estimate of millis per year, so that the division calculates based on 365.25 (or a more refined version if you prefer)? It's still wrong, but it won't exhibit this particular misbehaviour.
In the end, of course, what we want is yeardiff minus one, or yeardiff exactly if the date with an earlier year is earlier in that year than now is in the current year. In the case in the WTF, it would use just yeardiff-1, which is 6, which is less than 7.
Edit Admin
yes, the number of seconds per year is 31557600, not 31536000
Edit Admin
Once upon a midnight dreary, fingers cramped and vision bleary, system manuals piled high and wasted paper on the floor...