Fixed an issue where the query tool went blank when converting history dates to the appropriate locale format. #8632

pull/8657/head
Aditya Toshniwal 2025-04-14 12:43:05 +05:30
parent 31b1af2f84
commit 18f47a59c5
3 changed files with 0 additions and 19 deletions

View File

@ -511,17 +511,6 @@ def utils():
except Exception:
pg_libpq_version = 0
# Get the pgadmin server's locale
default_locale = ''
if current_app.PGADMIN_RUNTIME:
import locale
try:
locale_info = locale.getlocale()
if len(locale_info) > 0 and locale_info[0] != 'C':
default_locale = locale_info[0].replace('_', '-')
except Exception:
current_app.logger.debug('Failed to get the default locale.')
for submodule in current_blueprint.submodules:
snippets.extend(submodule.jssnippets)
@ -559,7 +548,6 @@ def utils():
qt_default_placeholder=QT_DEFAULT_PLACEHOLDER,
vw_edt_default_placeholder=VW_EDT_DEFAULT_PLACEHOLDER,
enable_psql=config.ENABLE_PSQL,
pgadmin_server_locale=default_locale,
_=gettext,
auth_only_internal=auth_only_internal,
mfa_enabled=is_mfa_enabled(),

View File

@ -63,9 +63,6 @@ define('pgadmin.browser.utils',
pgAdmin['fixed_binary_paths'] = {{ current_app.config.get('FIXED_BINARY_PATHS') }};
/* GET the pgadmin server's locale */
pgAdmin['pgadmin_server_locale'] = '{{pgadmin_server_locale}}';
/* Server Heartbeat Timeout */
pgAdmin['heartbeat_timeout'] = '{{heartbeat_timeout}}';

View File

@ -117,14 +117,10 @@ export const QuerySources = {
};
function getDateFormatted(date) {
if (pgAdmin['pgadmin_server_locale'] !== '')
return date.toLocaleDateString(pgAdmin['pgadmin_server_locale']);
return date.toLocaleDateString();
}
function getTimeFormatted(time) {
if (pgAdmin['pgadmin_server_locale'] !== '')
return time.toLocaleTimeString(pgAdmin['pgadmin_server_locale']);
return time.toLocaleTimeString();
}