Day.js Timezone Plugin: .tz() Function Not Working in Capacitor WebView on Android and iOS
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Bug**
When using Day.js with the timezone plugin in a Capacitor WebView, an error occurs:
"TypeError: Dv(...).tz is not a function."
**Expected behaviour**
The .tz function should correctly process and convert timezones as expected when using the Day.js timezone plugin. The method should allow manipulating and displaying time in different time zones without throwing an error.
**Information**
Day.js Versions: 1.11.13, 1.11.7
Operating System: Android, iOS
Capacitor Version: 5.7.8
Environment: Capacitor WebView
This issue persists even after updating to the latest Day.js versions and ensuring all dependencies are properly installed. The same code works as expected in a browser but fails within the Capacitor WebView on both Android and iOS. Screenshots have been attached for further reference.
**Screenshots**
The attached screenshots were captured using chrome://inspect/#devices for remote debugging of the WebView:


Contributor guide
Research direction
Start by reproducing the Day.js timezone plugin's .tz() call in a Capacitor 5.7.8 WebView on Android and iOS, using versions 1.11.13 and 1.11.7, then compare it with the browser behavior. Done means timezone conversion works without the "tz is not a function" error on both mobile platforms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100