I am using Moment.js in my project and formatting dates as follows:
var date = moment.unix(1318781876);
return date.format(\'LLLL\');
The m
As of momentjs documentation:
By default, Moment.js comes with English locale strings. If you need other locales, you can load them into Moment.js for later use.
You can change it with that:
moment.locale(locale);
To get the user's locale with javascript you can do that:
var locale = window.navigator.userLanguage || window.navigator.language;
Refer to: http://momentjs.com/docs/#/i18n/changing-locale/
and JavaScript for detecting browser language preference