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
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | timezone_detect_timezone_mapping-3496756-3.patch | 1.66 KB | khaled.zaidan |
Issue fork timezone_detect-3496756
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
Comment #2
khaled.zaidan commentedAdding the error message in the issue description.
Comment #3
khaled.zaidan commentedUploaded patch with the fix.
Comment #4
khaled.zaidan commentedComment #8
longwave