I am trying to debug a really strange string length problem in Internet Explorer 11.
I cannot work out why it is telling me that the string "01/03/2017" has a length of 15?
Can anyone tell me what I am doing wrong please?
Here is the function
function stringToUKDate(strDate) {
debugger;
newDate = strDate.trim().substr(0, 10);
var dateSplit = newDate.split("/");
var newDate = new Date(dateSplit[2], dateSplit[1] - 1, dateSplit[0], 0, 0, 0);
// return the new date
return newDate;
}
encodeURIComponent(strDate) gives me %E2%80%8E01%E2%80%8E%2F%E2%80%8E02%E2%80%8E%2F%E2%80%8E2017