yogurtearl
29 Jun 2007, 6:52 AM
the documentation (http://extjs.com/deploy/ext-1.1-beta2/docs/output/Date.html#getDayOfYear) for Date.getDayOfYear says:
"returns: 0 through 365 (366 in leap years)"
That is one too many days. It should say "returns: 0 through 364 (365 in leap years)"
Although PHP starts numbering days of the years at 0, this is not standard.
ISO 8601 says that ordinal dates (http://en.wikipedia.org/wiki/ISO_8601#Ordinal_dates)should start with 1.
Java's DAY_OF_YEAR (http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html#DAY_OF_YEAR) also start with 1.
The unix date command (http://unixhelp.ed.ac.uk/CGI/man-cgi?date) (%j) starts at one also.
Any chance of getting Date.getDayOfYear to conform to the standard?
"returns: 0 through 365 (366 in leap years)"
That is one too many days. It should say "returns: 0 through 364 (365 in leap years)"
Although PHP starts numbering days of the years at 0, this is not standard.
ISO 8601 says that ordinal dates (http://en.wikipedia.org/wiki/ISO_8601#Ordinal_dates)should start with 1.
Java's DAY_OF_YEAR (http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html#DAY_OF_YEAR) also start with 1.
The unix date command (http://unixhelp.ed.ac.uk/CGI/man-cgi?date) (%j) starts at one also.
Any chance of getting Date.getDayOfYear to conform to the standard?