mozilla/gcli — pull request #63 by pquentin (2013-04-12 16:23:38+00:00)
Title: complete date type implementation

This works in a demo command named 'gcli onedate' and is tested in
testDate.js. It supports the increment/decrement, parse/stringify and
min/max operations.

Increments steps are specifiable, and the unit is currently days. For
example, with a step of 5, 'Tue Jan 15 2013 15:46:29 GMT+0100 (CET)'
becomes 'Sun Jan 20 2013 15:46:29 GMT+0100 (CET)'.

Notes:
* There is no integration with the cookie command yet.
* MDN says that n should be between 1 and 31 for Date.setDate(n), but
it seems to work with any number on Firefox and Chrome, and I "abuse"
this behavior.
* the parse() test assumes that two subsequent 'new Date()' will share
the same second, but it's possible for the test to fail, especially
on slow machines.
* 'gcli twodates' is disabled since a bug prevents from having two
parameters with spaces delimited by quotes and testing increments.
* I'm not sure how I can report an error in increment/decrment using
typesDateMax and typesDateMin since they don't return a Conversion.