mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02: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:
@@ -1,6 +1,13 @@
|
|||||||
angular.module('longDateFilter', []).filter('longDate', function() {
|
angular.module('longDateFilter', []).filter('longDate', function() {
|
||||||
return function(input) {
|
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');
|
return date.format('l LTS');
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user