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?
Add this to your pipe:
| date:'d/M/yy':'UTC+6'
I recommend using toLocaleDateString() in your case:
toLocaleDateString()
var date = new Date().toLocaleDateString('he-IL'); console.log(date); date = date.replace(/\./g, '/'); console.log(date);
Copyright © 2021 Jogjafile Inc.
Add this to your pipe: