@brightspace-ui/intl 3.34.3 → 3.34.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -139,23 +139,6 @@ export class TimeZoneMapper {
139
139
  return result;
140
140
  }
141
141
  /**
142
- * Get all timeZones for a specific region
143
- * @param {string} regionCode - ISO 3166-1 alpha-2 region code
144
- * @returns {string[]} Array of timeZone identifiers
145
- */
146
- getTimeZonesForRegion(regionCode) {
147
- this._ensureLoaded();
148
- const timeZones = [];
149
-
150
- for (const [timeZone, info] of this.mappings.entries()) {
151
- if (info.regionCode === regionCode.toUpperCase()) {
152
- timeZones.push(timeZone);
153
- }
154
- }
155
-
156
- return timeZones.sort();
157
- }
158
- /**
159
142
  * Load timeZone mappings from a single combined object
160
143
  * @param {Object} timeZoneData - Combined timeZone data object
161
144
  */
package/lib/timeZones.js CHANGED
@@ -1,38 +1,18 @@
1
1
  import { getDocumentLocaleSettings } from './common.js';
2
2
  import { TimeZoneMapper } from './_timeZones/mapper.js';
3
3
 
4
- let timeZoneData;
5
- getDocumentLocaleSettings().addChangeListener(() => timeZoneData = null);
6
-
7
4
  const tzMap = {
8
5
  'Asia/Calcutta': 'Asia/Kolkata',
9
6
  };
10
7
 
11
8
  let timeZoneIdentifiers = null;
12
- export function getTimeZoneIdentifiers() {
9
+ function getTimeZoneIdentifiers() {
13
10
  if (timeZoneIdentifiers === null) {
14
11
  timeZoneIdentifiers = Intl.supportedValuesOf?.('timeZone').map(t => tzMap[t] || t) || [];
15
12
  }
16
13
  return timeZoneIdentifiers;
17
14
  }
18
15
 
19
- export async function getTimeZonesData(region, modules) {
20
- let timeZones;
21
- const mapper = new TimeZoneMapper(modules);
22
- await mapper.loadMappings();
23
-
24
- if (region) {
25
- timeZones = new Intl.Locale(`en-${region}`).getTimeZones?.();
26
- if (!timeZones?.length) {
27
- timeZones = mapper.getTimeZonesForRegion(region);
28
- }
29
- } else {
30
- if (timeZoneData) return timeZoneData;
31
- timeZones = getTimeZoneIdentifiers();
32
- }
33
- return await Promise.all(timeZones.map(l => getTimeZoneData(l, { mapper })));
34
- }
35
-
36
16
  export async function getTimeZoneData(
37
17
  identifier = getDocumentLocaleSettings().timezone.identifier,
38
18
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/intl",
3
- "version": "3.34.3",
3
+ "version": "3.34.4",
4
4
  "description": "Internationalization APIs for number, date, time and file size formatting and parsing in D2L Brightspace.",
5
5
  "main": "lib/number.js",
6
6
  "type": "module",