Re: dd/mm/yyyy Date Compare Problem



Dr John Stockton wrote:
I did mean that the de-*er would be distributed, for example on a web
page; then the material could be sent in full from library author to
each Web programmer, who could retail a full-glory reference copy but
use in pages the reduced version.

I don't see the difference - both the full version and the compacted version
are available on my site. A developer could download the full version for
reference and the compacted version for production. That's the intent, at
least :)

Date.dayAbbreviations = new
Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
Add a Sunday at the end of the week, and you can match ISO 8601 too!

This array is only useful when getting the index from getDay(), so adding
another 'Sun' at the end would be pointless.

I have heard that there is or has been a browser which, at least in
1900..2099, has getYear() returning Year%100, for which that fails.

Which browser? That's a broken implementation of getYear() anyway, so anyone
using such a browser surely has other issues ;)

There's no need to evaluate Leapness unless it's Feb 29. Feb <29 is
always good; Feb >29 always bad.

Valid point.

// Add an amount of time to a date. Negative numbers can be passed to
subtract time.
However, the amount of time actually added can depend on the date;
Years and Feb vary in length by a day, and days can vary by an hour.

This is true, but the result should meet expectations. Some time units are
not absolute, like month and year. Yet adding a year to 1/1/X should always
result in 1/1/(x+1) regardless of how much time that period actually
contained.

Date.prototype.add = function(interval, number) {
else if (interval=='w') { // Weekday
I think you are adding a number of WORKING days, stepwise.

Weekday = Mon-Fri, no? "Working day" has the same meaning to most, but not
all. Perhaps the same is true of "weekday"?

You have support for FIPS/ISO elsewhere?

Depends on what you mean, exactly. The functions parse/format functions are
intended to be independent of any specific standard or locale.

Thanks for your feedback.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com


.