Problem/Motivation

The jstz library returns "Asia/Calcutta", but Drupal expects "Asia/Kolkata".

This results in the following error in Drupal:
"Attempting to set timezone for user 283644 to Asia/Calcutta, but that does not appear to be a valid timezone id [timebox]"

Steps to reproduce

Spoof your location or timezone ID to Calcutta.
In Chrome this can be set in the dev tools > click on the 3 dots menu in the dev tools > More tools > Sensors
- Set location to "Other..."
- Set Timezone ID to "Asia/Calcutta"

Set the module to update timezone "whenever it changes" (3rd option)

Proposed resolution

The jstz library seems to no longer by maintained, maybe it's worth forking it and updating the list of timezones?

Otherwise, it might be best to to modify the returned timezone in JS after the library returns its result (so we avoid altering the library).

Remaining tasks

Implement solution above.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

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

khaled.zaidan created an issue. See original summary.

khaled.zaidan’s picture

Issue summary: View changes

Adding the error message in the issue description.

khaled.zaidan’s picture

Uploaded patch with the fix.

khaled.zaidan’s picture

Status: Active » Needs review

longwave made their first commit to this issue’s fork.

  • longwave committed 9fb326ac on 8.x-1.x
    Issue #3496756 by longwave, khaled.zaidan: Asia/Calcutta is now Asia/...
longwave’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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