Scooby JS Libraries
NOTE: The date.add and date.diff code in the date.js library have been contributed to the Dojo JavaScript? Toolkit. The Cosmo Web UI (formerly known as Scooby) will also be replacing our use of this custom Hash with dojo.collections code. This page now is mainly just for historical interest, and there will be no further maintenance or update of this code.
date.js
Methods for formatting and manipulating dates in JavaScript.
[
Download]
Date.strftime -- formats a date or time according to a given format string -- identical to the
strftime function found in many scripting languages such as Perl, Ruby, or PHP. This naive implementation uses only English, but it is fairly easy to add your own localized language.
Date.add -- Does date incrementation. API is the same as VBScript's
DateAdd function.
Date.diff -- Gets the difference between two dates in the specified units. API is the same as VBScript's
DateDiff function.
hash.js
Implements a fairly robust Hash class that has many of the same methods for iterating and sorting as the PHP Array.
[
Download]
Hash -- A class which implements something more robust than the JavaScript
Array when used as a hash, including a
length property, and various methods for sorting, stepping through, and removing items.