NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 593 - Week 53 is sometimes an error
Week 53 is sometimes an error
Status: RESOLVED FIXED
Product: Validator.nu
Classification: Unclassified
Component: HTML5 schema
HEAD
All All
: P2 minor
Assigned To: Nobody
http://html5.validator.nu/?showsource...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-14 13:02 CEST by Smylers
Modified: 2011-05-25 12:51 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Smylers 2009-07-14 13:02:54 CEST
Some years (such as 2009) have a week 53, while others (such as 2008) don't.  The value for <input type=week> must be a valid week string, which can only end in W53 for years with 53 weeks.

Validator.nu appears always to treat W53 as valid, regardless of the year; it should instead take the weekday of the first day of the year into account and only allow W53 if the year starts on a Thursday or is a leap year that starts on a Friday:

  http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#week-number-of-the-last-day
Comment 1 Smylers 2009-07-14 13:03:20 CEST
s/Friday/Wednesday/
Comment 2 Henri Sivonen 2011-05-19 17:46:33 CEST
AFAICT, the code that tries to do the right thing ends up saying week 53 is always *invalid*.
Comment 3 Henri Sivonen 2011-05-25 11:11:26 CEST
It appears that ICU4J is broken:
http://bugs.icu-project.org/trac/ticket/8596

Fixed by not using ICU4J:
https://bitbucket.org/validator/syntax/changeset/b632a0526ccf

I hope the fix is correct. I'm not fully confident that it is. However, it is correct per citationless claims on Wikipedia.