-1

Using angular 4 date pipe to format dates. For he-IL (Hebrew) locale I see the data format as dd.mm.yyyy instead of dd/mm/yyyy

Not sure why this discrepancy?

hem
  • 21
  • 3
  • What's your question? You can use a date pipe to define your own formatting, per the documentation. If you think the default internationalization is wrong you are free to open a ticket with the Angular team. – Roddy of the Frozen Peas Nov 12 '18 at 23:29

1 Answers1

0

I recommend using toLocaleDateString() in your case:

var date = new Date().toLocaleDateString('he-IL');
console.log(date);
date = date.replace(/\./g, '/');
console.log(date);
gotnull
  • 26,454
  • 22
  • 137
  • 203