summaryrefslogtreecommitdiffstatshomepage
path: root/core/misc/timezone.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/misc/timezone.js')
-rw-r--r--core/misc/timezone.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/misc/timezone.js b/core/misc/timezone.js
index 94bb564acd87..5d27fcde3b4a 100644
--- a/core/misc/timezone.js
+++ b/core/misc/timezone.js
@@ -8,9 +8,10 @@
(function ($, Drupal) {
Drupal.behaviors.setTimezone = {
attach: function attach(context, settings) {
- var $timezone = $(context).find('.timezone-detect').once('timezone');
+ var timezone = once('timezone', '.timezone-detect', context);
- if ($timezone.length) {
+ if (timezone.length) {
+ var $timezone = $(timezone);
var tz = new Intl.DateTimeFormat().resolvedOptions().timeZone;
if (tz && $timezone.find("option[value=\"".concat(tz, "\"]")).length) {