Why do i get this error, when i format my date? Code follows below
var date = /Date(1306348200000)/
function dateToString(date) {
return (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getYear();
}
function dateFromString(str) {
return new Date(str);
}
You define var date as a regular which can not be accepted by
new Date,just do it like this.try it like this: http://jsfiddle.net/zhiyelee/wLNSS/