Based on some findings, we are left with one way to create a map of local > format, as described in this post below:
Latest “UserContext” based approach is not safe as its private API, and defining a locale map requires us to know and match all locale <> date formats with salesforce.
Anyone having a better/clean solution for this ?
If these methods used perfectly date according to user local format and timezone can be shown.
But it has an issue with it. Using these methods cross-browser it show different results so these methods won’t work.
The only solution to show correct date is used moment.js. It is best library to format date and time according to language, timezone and country. It completely support automatic and manual formatting of date and time from any valid date string/instance according to local settings. Its results are consistent in all browsers. Docs: http://momentjs.com/docs/