Problem/Motivation

timezone.js generates this kind of AJAX URL: /system/timezone/0/3600/0?date=Sun%20Mar%2023%202025%2015%3A58%3A36%20GMT%2B0100%20(heure%20normale%20d%E2%80%99Europe%20centrale)

But it seems the date query parameter is never used in TimezoneController.

Steps to reproduce

I'm not sure how to trigger the AJAX call, it seems it is only triggered if new Intl.DateTimeFormat().resolvedOptions().timeZone returns an unsupported timezone name.

Proposed resolution

Remove the parameter and make sure it does not break anything.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3514881

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

prudloff created an issue. See original summary.

mradcliffe’s picture

Issue tags: -Novice

I am removing the Novice tag from this issue because I think the resolution is ambiguous with the does not break anything comment.

I’m using this documentation as a source: https://www.drupal.org/community/contributor-guide/task/triage-novice-is...

prudloff’s picture

Status: Active » Needs review
smustgrave’s picture

do we know if a contrib module could be using this?

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Lets see what committers think.

  • catch committed e83d1138 on 11.x
    Issue #3514881 by prudloff: timezone.js calls the system.timezone route...
catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Needs followup

This needs git archaeology before it can be committed - we need to know whether this was never used, whether it should be used, whether it recently became unused because of other changes etc.

The dateString argument has been sent since:

commit b4435decef6ebbfa2c5e9da23c2916fca3b04f57
Author: Angie Byron <webchick@24967.no-reply.drupal.org>
Date:   Fri Nov 21 04:33:28 2008 +0000

    #11077 follow-up: adding missing timezone.js file.

The original menu callback was this:

 
 /**
+ * Menu callback; Retrieve a JSON object containing a suggested time zone name.
+ */
+function system_timezone($abbreviation = '', $offset = -1, $is_daylight_saving_time = NULL) {
+  // An abbreviation of "0" passed in the callback arguments should be
+  // interpreted as the empty string.
+  $abbreviation = $abbreviation ? $abbreviation : '';
+  $timezone = timezone_name_from_abbr($abbreviation, intval($offset), $is_daylight_saving_time);
+  drupal_json($timezone);
+}
+

So this was added in 2008 with the original issue, and has never been used.

But also - I think we should open a follow-up to look into removing the route and AJAX request, if it's only a fallback for non-compliant browsers, then we should be able to fall back to the user selecting their own timezone.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.