@manhng

Welcome to my blog!

Problem with new Date().toLocaleDateString() in IE11

July 17, 2019 09:59

IE11 Date Problem (edit)

IE11 > F12 to Debug > Copy date string value > Paste in w3schools

https://stackoverflow.com/questions/21413757/tolocaledatestring-changes-in-ie11

https://stackoverflow.com/questions/25294363/ie-11-issue-with-javascript-tolocaledatestring-formatting

Usage Code

<!DOCTYPE html>
<html>
<body>

<p>Click the button to extract characters from the string.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
var str = "‎MM‎/‎dd‎/‎yyyy".replace(/\u200E/g, '');

document.getElementById("demo").innerHTML = str;
}
</script>

</body>
</html>Abc

Categories

Recent posts