diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-08-18 17:47:37 +0200 |
---|---|---|
committer | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-08-25 11:05:36 +0200 |
commit | f6276b3b6fecce2b160ed8bdc62a3e87439249e4 (patch) | |
tree | d1c69e7f786b8693fb13dd816624794eb6b07ae7 /server/sonar-web/src/main/js/helpers/handlebars/dt.js | |
parent | 1ddf3ee7dbf26116afb767003a8a0698965c4f70 (diff) | |
download | sonarqube-f6276b3b6fecce2b160ed8bdc62a3e87439249e4.tar.gz sonarqube-f6276b3b6fecce2b160ed8bdc62a3e87439249e4.zip |
SONAR-9385 SONAR-9436 Replace moment with react-intl
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/handlebars/dt.js')
-rw-r--r-- | server/sonar-web/src/main/js/helpers/handlebars/dt.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/helpers/handlebars/dt.js b/server/sonar-web/src/main/js/helpers/handlebars/dt.js index 708be097e33..3af77ae1d6c 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/dt.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/dt.js @@ -17,8 +17,12 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -const moment = require('moment'); - module.exports = function(date) { - return moment(date).format('LLL'); + return new Intl.DateTimeFormat(localStorage.getItem('l10n.locale') || 'en', { + year: 'numeric', + month: 'long', + day: 'numeric', + hour: 'numeric', + minute: 'numeric' + }).format(new Date(date)); }; |