Recently I have come across a use case where the requirement was to display dates in a particular format . The project is developed in Vanilla Javascript. After doing some analysis I found that there is no inbuilt function in javascript to perform th...
Full stack developer but loves frontend
developer from INDIA
Markdown supported · ⌘↵ to post
Chris Bongers
The toLocaleString is also really cool to use on date objects in JavaScript!
var dateOfBirth = '08-05-1989'; console.log(dateOfBirth.toLocaleString()); // '08/05/1989' (EU Setting)