
A Javascript date library - mcxx
http://www.datejs.com/
======
midnightmonster
I've used the library in a real project, and I'm on the mailing list. FYI,
there doesn't seem to be much development activity going on, nor is it so
perfect and complete that further development is unneeded. That's not to
discourage anyone from using it, since it's the only JS lib I know that fills
the same niche, just to let you know you may need to get your hands dirty.
(I've got a patch waiting for integration but not enough attention available
to test it for use cases that are not mine and really push it through. If you
do have the interest and bandwidth to polish whatever improvements you make,
you could probably help quite a bit.)

~~~
mcxx
What parts did you miss?

~~~
midnightmonster
My patch (which can be found discussed in the mailing list) provides a
callback hook to modify the final result given the parsed details. I use it to
modify assumptions: e.g., if you just type a year, for the final output, the
library assumes the rest of the date should be jan 1, but if this field is the
end of a date range, it should probably be dec 31 since "burglaries from 2001
to 2002" means the burglaries in 2001 and in 2002. I think it's an important
function, and the original author agreed, but neither of us has had the time
to test and time everything for all the relevant codepaths to make it into the
library.

Other posters have had other complaints about missing functionality--some
struck me as reasonable, some not so much--but I haven't kept track.

------
rivo
My first test was "6.2.2009" and it said "June 2, 2009" where I expected "Feb
6, 2009". So it'll be only usable for an American audience.

------
alexk
And a JS timezone library: <http://js.fleegix.org/plugins/date/date>

------
unwind
No support for fortnights?! I'm shocked at the omission of this critical unit
of time, used throughout society.

~~~
jdbeast00
in all seriousness, it did seem less intelligent than what i've seen (on
RTM.com for example). next june returns June 4th? wtf?

~~~
bdfh42
well today is the 4th. - which day in June 2010 would you pick as the default?

~~~
encoderer
This is the test I use on all date libraries I come across. I don't know what
the right answer is, I just want it to be logical:

(pseudo) Date d = new Date('1/31/2009'); d.addOneMonth();

What is the value of d? 2/28/09? 3/2/09? 2/25/09?

Writing a date library is not for the fainthearted.

~~~
dkl
And what date do you expect?

~~~
blasdel
In what country was the input formed?

~~~
mahmud
How profound.

------
mildweed
Previous related threads:

<http://news.ycombinator.com/item?id=84070>

<http://news.ycombinator.com/item?id=630258>

------
mtrimpe
I had the strangest bug with this library on Konfabulator a while ago where
all Date.toString()'s returned an object instead of a string.

Not really a useful thing to know but I wanted to post it anyhow.

------
psyklic
"the day before last Saturday" doesn't work

------
tdoggette
That's very spiffy. I wonder how it compares to some of the smarter Perl date
libraries?

------
callmeed
Curious if anyone has compared it to the Ruby chronic gem ...

------
mhansen
That interface... it's so fluent. I love javascript, for just the reason that
it's possible to have beautiful interfaces like this.

 _Date.today().add(3).days();_

Be even better if it let you leave off the brackets like ruby, but oh well.

