( f1: CustomFormats, timeZone?: string )
| 53 | } |
| 54 | |
| 55 | function deepMergeFormatsAndSetTimeZone( |
| 56 | f1: CustomFormats, |
| 57 | timeZone?: string |
| 58 | ): CustomFormats { |
| 59 | if (!timeZone) { |
| 60 | return f1 |
| 61 | } |
| 62 | const mfFormats = IntlMessageFormat.formats |
| 63 | return { |
| 64 | ...mfFormats, |
| 65 | ...f1, |
| 66 | date: deepMergeOptions( |
| 67 | setTimeZoneInOptions(mfFormats.date, timeZone), |
| 68 | setTimeZoneInOptions(f1.date || {}, timeZone) |
| 69 | ), |
| 70 | time: deepMergeOptions( |
| 71 | setTimeZoneInOptions(mfFormats.time, timeZone), |
| 72 | setTimeZoneInOptions(f1.time || {}, timeZone) |
| 73 | ), |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | export type FormatMessageFn<T> = ( |
| 78 | { |
no test coverage detected