Storybook does not natively support regional time zones
0 reputation · 05 Nov 2021, 12:31 UTC
Goal: Render dates and times consistently across local, CI, and user environments while developing components in Storybook.
Constraints: Storybook’s rendering surface is a real browser iframe, so new Date() and Intl.DateTimeFormat reflect the host machine’s clock and locale unless the story explicitly overrides them. The Viewport addon only changes layout dimensions, not regional formatting.
Uncertainty: There is no built‑in API to freeze time or switch time zones; developers must rely on decorators, global toolbar selectors, or external libraries.
Key questions:
1. What is the recommended pattern to mock a specific time zone in Storybook stories?
2. Does Storybook 8 introduce any new feature for time‑zone or locale overrides?
3. Can a global toolbar selector automatically reconfigure Intl without custom decorators?