diff --git a/awx/ui/static/js/shared/long-date.filter.js b/awx/ui/static/js/shared/long-date.filter.js index eadebc456e..5148dc2ee7 100644 --- a/awx/ui/static/js/shared/long-date.filter.js +++ b/awx/ui/static/js/shared/long-date.filter.js @@ -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'); }; });