@formatjs/intl-datetimeformat 6.12.6 → 6.14.0

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.
@@ -1,4 +1,4 @@
1
- import { IntlDateTimeFormatInternal, DateTimeFormatLocaleInternalData, IntlDateTimeFormatPart, DateTimeFormat } from '@formatjs/ecma402-abstract';
1
+ import { DateTimeFormat, DateTimeFormatLocaleInternalData, IntlDateTimeFormatInternal, IntlDateTimeFormatPart } from '@formatjs/ecma402-abstract';
2
2
  import { ToLocalTimeImplDetails } from './ToLocalTime';
3
3
  export interface FormatDateTimePatternImplDetails {
4
4
  getInternalSlots(dtf: Intl.DateTimeFormat | DateTimeFormat): IntlDateTimeFormatInternal;
@@ -1,6 +1,6 @@
1
- import { TimeClip, } from '@formatjs/ecma402-abstract';
2
- import { DATE_TIME_PROPS } from './utils';
1
+ import { TimeClip, createMemoizedNumberFormat, } from '@formatjs/ecma402-abstract';
3
2
  import { ToLocalTime } from './ToLocalTime';
3
+ import { DATE_TIME_PROPS } from './utils';
4
4
  function pad(n) {
5
5
  if (n < 10) {
6
6
  return "0".concat(n);
@@ -45,18 +45,18 @@ export function FormatDateTimePattern(dtf, patternParts, x, _a) {
45
45
  var locale = internalSlots.locale;
46
46
  var nfOptions = Object.create(null);
47
47
  nfOptions.useGrouping = false;
48
- var nf = new Intl.NumberFormat(locale, nfOptions);
48
+ var nf = createMemoizedNumberFormat(locale, nfOptions);
49
49
  var nf2Options = Object.create(null);
50
50
  nf2Options.minimumIntegerDigits = 2;
51
51
  nf2Options.useGrouping = false;
52
- var nf2 = new Intl.NumberFormat(locale, nf2Options);
52
+ var nf2 = createMemoizedNumberFormat(locale, nf2Options);
53
53
  var fractionalSecondDigits = internalSlots.fractionalSecondDigits;
54
54
  var nf3;
55
55
  if (fractionalSecondDigits !== undefined) {
56
56
  var nf3Options = Object.create(null);
57
57
  nf3Options.minimumIntegerDigits = fractionalSecondDigits;
58
58
  nf3Options.useGrouping = false;
59
- nf3 = new Intl.NumberFormat(locale, nf3Options);
59
+ nf3 = createMemoizedNumberFormat(locale, nf3Options);
60
60
  }
61
61
  var tm = ToLocalTime(x,
62
62
  // @ts-ignore