From 24389388cd9889e71c9a6712a74aa7466ce4d85c Mon Sep 17 00:00:00 2001 From: Fabio Anderegg Date: Fri, 2 Dec 2016 11:42:56 +0100 Subject: [PATCH] javascript: use ckan locale instead of browser locale to format dates --- ckan/public/base/javascript/main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ckan/public/base/javascript/main.js b/ckan/public/base/javascript/main.js index 1df0c2802cf..f66d3a42155 100644 --- a/ckan/public/base/javascript/main.js +++ b/ckan/public/base/javascript/main.js @@ -20,7 +20,6 @@ this.ckan = this.ckan || {}; ckan.initialize = function () { var body = jQuery('body'); var locale = jQuery('html').attr('lang'); - var browserLocale = window.navigator.userLanguage || window.navigator.language; var location = window.location; var root = location.protocol + '//' + location.host; @@ -33,7 +32,7 @@ this.ckan = this.ckan || {}; // Convert all datetimes to the users timezone jQuery('.automatic-local-datetime').each(function() { - moment.locale(browserLocale); + moment.locale(locale); var date = moment(jQuery(this).data('datetime')); if (date.isValid()) { jQuery(this).html(date.format("LL, LT ([UTC]Z)"));