Added a useful function to date.js.