From bd69fe5b66f317af590b5e3efd3bcb0b76cd898d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 8 Jul 2013 11:15:40 +0200 Subject: [PATCH] Use jQuery.datepicker date formatting instead of own code --- js/config.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/js/config.js b/js/config.js index b7115a6e94..a7a4b43ce8 100644 --- a/js/config.js +++ b/js/config.js @@ -751,24 +751,13 @@ function savePrefsToLocalStorage(form) function updatePrefsDate() { var d = new Date(window.localStorage['config_mtime_local']); - var msg = PMA_messages.strSavedOn.replace('@DATE@', formatDate(d)); + var msg = PMA_messages.strSavedOn.replace( + '@DATE@', + $.datepicker.formatDate('yy-mm-dd', d) + ' ' + $.datepicker.formatTime('HH:mm', d) + ); $('#opts_import_local_storage div.localStorage-exists').html(msg); } -/** - * Returns date formatted as YYYY-MM-DD HH:II - * - * @param {Date} d - */ -function formatDate(d) -{ - return d.getFullYear() + '-' + - (d.getMonth() < 10 ? '0' + d.getMonth() : d.getMonth()) + - '-' + (d.getDate() < 10 ? '0' + d.getDate() : d.getDate()) + - ' ' + (d.getHours() < 10 ? '0' + d.getHours() : d.getHours()) + - ':' + (d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()); -} - /** * Prepares message which informs that localStorage preferences are available and can be imported */