Add wrapper function for formatting datetime
This makes it easier to use and correctly converts params which formatTime expects.
This commit is contained in:
parent
625bc13c14
commit
acb997206e
@ -753,7 +753,7 @@ function updatePrefsDate()
|
||||
var d = new Date(window.localStorage['config_mtime_local']);
|
||||
var msg = PMA_messages.strSavedOn.replace(
|
||||
'@DATE@',
|
||||
$.datepicker.formatDate('yy-mm-dd', d) + ' ' + $.datepicker.formatTime('HH:mm', d)
|
||||
PMA_formatDateTime(d)
|
||||
);
|
||||
$('#opts_import_local_storage div.localStorage-exists').html(msg);
|
||||
}
|
||||
|
||||
@ -3919,3 +3919,21 @@ $('a.login-link').live('click', function (e) {
|
||||
$(window).resize(DynamicBoxes);
|
||||
});
|
||||
})();
|
||||
|
||||
/**
|
||||
* Formats timestamp for display
|
||||
*/
|
||||
function PMA_formatDateTime(date, seconds) {
|
||||
var result = $.datepicker.formatDate('yy-mm-dd', date);
|
||||
var timefmt = 'HH:mm';
|
||||
if (seconds) {
|
||||
timefmt = 'HH:mm:ss';
|
||||
}
|
||||
return result + ' ' + $.datepicker.formatTime(
|
||||
timefmt, {
|
||||
hour: date.getHours(),
|
||||
minute: date.getMinutes(),
|
||||
second: date.getSeconds()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -1424,13 +1424,9 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
|
||||
function PMA_getLogAnalyseDialog(min, max) {
|
||||
$('#logAnalyseDialog input[name="dateStart"]')
|
||||
.val(
|
||||
$.datepicker.formatDate('yy-mm-dd', min) + ' ' + $.datepicker.formatTime('HH:mm:ss', min)
|
||||
);
|
||||
.val(PMA_formatDateTime(min, true));
|
||||
$('#logAnalyseDialog input[name="dateEnd"]')
|
||||
.val(
|
||||
$.datepicker.formatDate('yy-mm-dd', max) + ' ' + $.datepicker.formatTime('HH:mm:ss', max)
|
||||
);
|
||||
.val(PMA_formatDateTime(max, true));
|
||||
|
||||
var dlgBtns = { };
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user