Since a lot of you folks are getting into client-side work via AJAX I
thought you might be able to use this.

I've put together a JavaScript library which extends the Date object with
four new features.  The library is here (long URL alert):

<http://www.depressedpress.com/Content/Development/JavaScript/Extensions/DP_
DateExtensions/Index.cfm>

The four new features are:

+) A full-featured "timeFormat()" method mirroring (and slightly extending)
the ColdFusion TimeFormat() function.  In other words you can finally do
this in JavaScript:

+) A full-featured "dateFormat()" method mirroring the ColdFusion
DateFormat() function.

+) A convenience method which lets you easily generate several ISO 8601 date
formats in accordance with the W3C note on the subject.

+) A static method which allows you to parse those same ISO 8601 dates into
native JavaScript dates.

Using the formatting functions you can finally do something like this in
JavaScript:

document.write("It's " + myDate.timeFormat('hh:mm:ss tt') + " on " +
myDate.dateFormat('dddd mmmm d, yyyy'));

The ISO date parsing/conversion stuff works great when using XML dialects
that support them.

Anyway I find this library very useful and I hope you will as well.  If you
find any bugs or have any suggestions please let me know.

Jim Davis



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244513
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to