I also found this broken in node.JS. For example, in the node console, type
new Date().toLocaleDateString('en-GB')
It still displays US format. Using the Werner method above, you can override the default behavior of Date.toLocaleDateString () for your language:
Date.prototype.toLocaleDateString = function () {
return `${this.getDate()}/${this.getMonth() + 1}/${this.getFullYear()}`;
};
source
share