I need this javascript function to not split a yyyy-mm-dd but split a yyymmdd. Current date formats are 2011-11-02 but this function needs to work with 20111102.
Script:
function evaluateEventDate(eventdate, date){
var eventdate = eventdate.split('-');
var date = date.split('-');
if (eventdate[0] === 'yyyy')
{
eventdate[0] = date[0];
}
if (eventdate[1] === 'mm')
{
eventdate[1] = date[1];
}
if (eventdate[2] === 'dd')
{
eventdate[2] = date[2];
}
return eventdate[0]+'-'+eventdate[1]+'-'+eventdate[2];
};