I've just updated my ColdFusion-inspired JavaScript Date Format script to version 1.0 1.1, and updated the documentation in the old post along with it. The new release includes "Z" (US timezone abbreviation) and "o" (UTC offset) flags as well as brevity enhancements from Scott Trenda, along with several other new features including a standalone dateFormat
function, named and default masks (plus you can easily add your own), easier internationalization, etc.
This update includes one change which is not backwards compatible: mask characters and sequences no longer have to comprise entire words for them to be treated specially. The former handling was intended to make it dead-easy to mix literal characters into date masks, but ended up mostly just being a slight nuisance since most people didn't use it to embed dates in larger strings.
Check out the new Date Format!
Edit: Date Format is now integrated into two JavaScript frameworks:
- CFJS is a library of almost 70 ColdFusion functions written in JavaScript by Chris Jordan. CFJS has used Date Format, which was a natural fit since it's largely based on ColdFusion's
dateFormat
andtimeFormat
functions, since version 0.1. - Chiron is an innovative, emerging JavaScript library by Kris Kowal. It's based on Python idioms, and at its heart is an advanced module loader and isolation system the likes of which hasn't been seen yet in the JavaScript world. In addition to integrating Date Format as a module called date.js, Chiron has also integrated my XRegExp library, and uses regular expressions from parseUri in its core. Expect to hear more about Chiron as it gets closer to 0.1 release.