Skip to content

@jalali-js/vue / use-resolved-timezone / useResolvedTimeZone

Function: useResolvedTimeZone()

useResolvedTimeZone(timeZone?): Ref<string>

Defined in: vue/src/use-resolved-timezone.ts:12

Resolves timeZone (default 'auto') the SSR-safe way described in architecture.md: the initial render, on both the server and the client's first (hydrating) pass, reads 'UTC' for 'auto', since resolveTimeZone() itself already returns 'UTC' with no window global. Those two renders match, so there is no hydration mismatch. onMounted then re-reads the real browser timezone (a client-only lifecycle hook, never called during SSR) and triggers one more render with the corrected value.

Parameters

timeZone?

string = 'auto'

Returns

Ref<string>