MCPcopy Index your code
hub / github.com/formatjs/formatjs / setTimeZoneInOptions

Function setTimeZoneInOptions

packages/intl/message.ts:25–39  ·  view source on GitHub ↗
(
  opts: Record<string, Intl.DateTimeFormatOptions>,
  timeZone: string
)

Source from the content-addressed store, hash-verified

23import {invariant} from '#packages/intl/utils.js'
24
25function setTimeZoneInOptions(
26 opts: Record<string, Intl.DateTimeFormatOptions>,
27 timeZone: string
28): Record<string, Intl.DateTimeFormatOptions> {
29 return Object.keys(opts).reduce(
30 (all: Record<string, Intl.DateTimeFormatOptions>, k) => {
31 all[k] = {
32 timeZone,
33 ...opts[k],
34 }
35 return all
36 },
37 {}
38 )
39}
40
41function deepMergeOptions(
42 opts1: Record<string, Intl.DateTimeFormatOptions>,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected