Finally, I just pre-processed the date. The add_scores () function simply adds a '-' after each two characters.
$.datepicker.parseDate('ymmdd', add_scores('070126')); add_scores('070126'); //=> '07-01-26' function normalize_date(date){ var normalized_date = []; $.each("ymd", function(index, format_option){ normalized_date.push(date[index*2] + date[(index*2)+1]); }); return normalized_date.toString().replace(/,/g, '-'); }
source share