Add wrapper function for formatting datetime
This makes it easier to use and correctly converts params which formatTime expects. Conflicts: js/functions.js
This commit is contained in:
parent
9d0a1f61db
commit
6120e01a3f
@ -740,7 +740,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);
|
||||
}
|
||||
|
||||
@ -1894,8 +1894,8 @@ function PMA_SQLPrettyPrint(string)
|
||||
|
||||
jQuery.fn.PMA_confirm = function(question, url, callbackFn) {
|
||||
var confirmState = PMA_commonParams.get('confirm');
|
||||
// when the Confirm directive is set to false in config.inc.php
|
||||
// and not changed in user prefs, confirmState is ""
|
||||
// when the Confirm directive is set to false in config.inc.php
|
||||
// and not changed in user prefs, confirmState is ""
|
||||
// when it's unticked in user prefs, confirmState is 1
|
||||
if (confirmState === "" || confirmState === "1") {
|
||||
// user does not want to confirm
|
||||
@ -3526,7 +3526,7 @@ function PMA_tooltip($elements, item, myContent, additionalOptions)
|
||||
tooltipClass: "tooltip",
|
||||
track: true,
|
||||
show: false,
|
||||
hide: false
|
||||
hide: false
|
||||
};
|
||||
|
||||
$elements.tooltip($.extend(true, defaultOptions, additionalOptions));
|
||||
@ -3845,3 +3845,21 @@ $('a.login-link').live('click', function(e) {
|
||||
e.preventDefault();
|
||||
window.location.reload(true);
|
||||
});
|
||||
|
||||
/**
|
||||
* 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()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -1410,13 +1410,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