eGovPDX / Council-Agenda-App

5 stars 0 forks source link

Formatted Dates #17

Closed OscarGodson closed 13 years ago

OscarGodson commented 13 years ago

Currently the dates are in raw MySQL form. Need a JS fix for styling them.

earenson commented 13 years ago

Possible solution may be found in this handy dateFormat() function here: http://blog.stevenlevithan.com/archives/date-time-format

OscarGodson commented 13 years ago

Thanks that worked perfect!

OscarGodson commented 13 years ago

Darn, IE8 is dying with this script. I'll need an alternative or figure out a fix to it

OscarGodson commented 13 years ago

Fixed it with this "proxy" function which corrects issues with CF formatted dates and also fixes a bug in the function itself:

/**
 * Proxy function to make dateFormat work in IE8 and also with Coldfusion dates
 */
var formatDate = function(date,mask){
    return dateFormat(new Date(date.split('.')[0].replace(/-/g,'/')),mask);
}