I'm developing an AngularJS application and we want to display dates in the same format as the user's OS. For example, my OS shows the date as YYYY-MM-DD, so I would like dates to be displayed in the same format.
I tried using toLocalDateString(navigator.language) but this gives me a date format of DD/MM/YYYY, not at all what my OS shows.
Any help is greatly appreciated.