mirror of
https://github.com/ansible/awx.git
synced 2026-01-19 13:41:28 -03:30
adding the locale files for moment.js
also adjusted the source of its locale setting to be more comprehensive (use navigator.language and navigator.languages)
This commit is contained in:
parent
609ded80e2
commit
c2a5b21b9e
@ -1,6 +1,13 @@
|
||||
angular.module('longDateFilter', []).filter('longDate', function() {
|
||||
return function(input) {
|
||||
var date = moment(input).locale(navigator.language);
|
||||
|
||||
// navigator.language is available in all modern browsers.
|
||||
// however navigator.languages is a new technology that
|
||||
// lists the user's preferred languages, the first in the array
|
||||
// being the user's top choice. navigator.languages is currently
|
||||
// comptabile with chrome>v32, ffox>32, but not IE/Safari
|
||||
var lang = navigator.languages ? navigator.languages[0] : (navigator.language || navigator.userLanguage),
|
||||
date = moment(input).locale(lang);
|
||||
return date.format('l LTS');
|
||||
};
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user