CFJS 1.1.12
This release contains a small change to the DateFormat() function.
Previously, the CFJS version of DateFormat() required a JavaScript date object to be passed in as it's first argument. Now, however the user can pass in a string representation of a date and the function will attempt to convert this to a Date object for processing.
The following snippets work just fine:
var my = {};
my.date = "Sep 12 1975";
my.date_formatted = $.DateFormat(my.date,"mm/dd/yyyy");
document.write(my.date_formatted)
my.date = "Sep 12 1975";
my.date_formatted = $.DateFormat(my.date,"mm/dd/yyyy");
document.write(my.date_formatted)
var my = {};
my.date = "9/12/1975";
my.date_formatted = $.DateFormat(my.date,"mm/dd/yyyy");
document.write(my.date_formatted)
Let's include the time in this example... yep still works
my.date = "9/12/1975";
my.date_formatted = $.DateFormat(my.date,"mm/dd/yyyy");
document.write(my.date_formatted)
var my = {};
my.date = "November, 23 1975 11:45 PM";
my.date_formatted = $.DateFormat(my.date,"mm/dd/yyyy hh:MM:ss TT");
document.write(my.date_formatted)
my.date = "November, 23 1975 11:45 PM";
my.date_formatted = $.DateFormat(my.date,"mm/dd/yyyy hh:MM:ss TT");
document.write(my.date_formatted)
So this also would work
var my = {};
my.date_formatted = $.DateFormat("September, 12 1975","mm/dd/yyyy");
document.write(my.date_formatted)
my.date_formatted = $.DateFormat("September, 12 1975","mm/dd/yyyy");
document.write(my.date_formatted)
The following code snippet does NOT work:
var my = {};
my.date = "09-12-1975";
my.date_formatted = $.DateFormat(my.date,"mm/dd/yyyy hh:MM:ss TT");
document.write(my.date_formatted)
my.date = "09-12-1975";
my.date_formatted = $.DateFormat(my.date,"mm/dd/yyyy hh:MM:ss TT");
document.write(my.date_formatted)
JavaScript doesn't recognize the dash as a date separator (apparently) in order to convert the string to a date.
Anyway, I hope this little addition to the DateFormat function makes it more useful to folks. I know it did for me, since I'm the one who needed the change in the first place! :o)
TweetBacks



So, instead of:
$.ArrayLen(myArray); // the jQuery way...
you could use:
CFJS.ArrayLen(myArray); // the non-jQuery way...
Just get the non-jQuery branch from SVN if that's what you'd prefer. Either way, I hope you find it useful! :o)
(Hey, I just checked out your site and noticed that you're in Ft. Worth. Cool. I'm in the DFW area too!) :o)