Here's a note that may address a confusing point of the code: the time units represented in an entry are not intended to represent everything that a JavaScript Date object represents, but to be maximally compatible with a JavaScript Date object. This means, in particular, that some programmer-confusing designs of the Date object are accommodated in our code because the JavaScript Date object numbers the dates of a month from 1 to 31, just like general calendar use, but months are represented from 0 (January) to 11 (December). Similarly, hours range from 0 to 23 in the Date object.
This function is a constructor in terms of what it does, but it is not designed for the new keyword, as the entire constructor and this
is something that Crockford no longer includes in The Better Parts after he tried—in the wake of creating AdSafe, which forbade the use of the this
keyword for security reasons—to take the medicine he was prescribing for...