@formatjs/ecma402-abstract 1.2.6 → 1.4.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.
- package/{lib/src/BestAvailableLocale.d.ts → BestAvailableLocale.d.ts} +0 -0
- package/BestAvailableLocale.d.ts.map +1 -0
- package/{src/BestAvailableLocale.js → BestAvailableLocale.js} +0 -0
- package/{src/BestFitMatcher.d.ts → BestFitMatcher.d.ts} +1 -1
- package/BestFitMatcher.d.ts.map +1 -0
- package/{src/BestFitMatcher.js → BestFitMatcher.js} +0 -0
- package/{lib/src/CanonicalizeLocaleList.d.ts → CanonicalizeLocaleList.d.ts} +0 -0
- package/CanonicalizeLocaleList.d.ts.map +1 -0
- package/{src/CanonicalizeLocaleList.js → CanonicalizeLocaleList.js} +0 -0
- package/{lib/src/CanonicalizeTimeZoneName.d.ts → CanonicalizeTimeZoneName.d.ts} +0 -0
- package/CanonicalizeTimeZoneName.d.ts.map +1 -0
- package/{src/CanonicalizeTimeZoneName.js → CanonicalizeTimeZoneName.js} +0 -0
- package/{lib/src/DateTimeFormat → DateTimeFormat}/BasicFormatMatcher.d.ts +1 -1
- package/DateTimeFormat/BasicFormatMatcher.d.ts.map +1 -0
- package/{src/DateTimeFormat → DateTimeFormat}/BasicFormatMatcher.js +0 -0
- package/{lib/src/DateTimeFormat → DateTimeFormat}/BestFitFormatMatcher.d.ts +1 -1
- package/DateTimeFormat/BestFitFormatMatcher.d.ts.map +1 -0
- package/{src/DateTimeFormat → DateTimeFormat}/BestFitFormatMatcher.js +9 -2
- package/{lib/src/DateTimeFormat → DateTimeFormat}/DateTimeStyleFormat.d.ts +1 -1
- package/DateTimeFormat/DateTimeStyleFormat.d.ts.map +1 -0
- package/{src/DateTimeFormat → DateTimeFormat}/DateTimeStyleFormat.js +0 -0
- package/{lib/src/DateTimeFormat → DateTimeFormat}/FormatDateTime.d.ts +0 -0
- package/DateTimeFormat/FormatDateTime.d.ts.map +1 -0
- package/{src/DateTimeFormat → DateTimeFormat}/FormatDateTime.js +0 -0
- package/DateTimeFormat/FormatDateTimePattern.d.ts +14 -0
- package/DateTimeFormat/FormatDateTimePattern.d.ts.map +1 -0
- package/{src/DateTimeFormat/PartitionDateTimePattern.js → DateTimeFormat/FormatDateTimePattern.js} +4 -16
- package/DateTimeFormat/FormatDateTimeRange.d.ts +4 -0
- package/DateTimeFormat/FormatDateTimeRange.d.ts.map +1 -0
- package/DateTimeFormat/FormatDateTimeRange.js +14 -0
- package/DateTimeFormat/FormatDateTimeRangeToParts.d.ts +4 -0
- package/DateTimeFormat/FormatDateTimeRangeToParts.d.ts.map +1 -0
- package/DateTimeFormat/FormatDateTimeRangeToParts.js +18 -0
- package/{src/DateTimeFormat → DateTimeFormat}/FormatDateTimeToParts.d.ts +2 -1
- package/DateTimeFormat/FormatDateTimeToParts.d.ts.map +1 -0
- package/{src/DateTimeFormat → DateTimeFormat}/FormatDateTimeToParts.js +1 -1
- package/{lib/src/DateTimeFormat → DateTimeFormat}/InitializeDateTimeFormat.d.ts +1 -1
- package/DateTimeFormat/InitializeDateTimeFormat.d.ts.map +1 -0
- package/{src/DateTimeFormat → DateTimeFormat}/InitializeDateTimeFormat.js +39 -27
- package/DateTimeFormat/PartitionDateTimePattern.d.ts +10 -0
- package/DateTimeFormat/PartitionDateTimePattern.d.ts.map +1 -0
- package/DateTimeFormat/PartitionDateTimePattern.js +24 -0
- package/DateTimeFormat/PartitionDateTimeRangePattern.d.ts +5 -0
- package/DateTimeFormat/PartitionDateTimeRangePattern.d.ts.map +1 -0
- package/DateTimeFormat/PartitionDateTimeRangePattern.js +103 -0
- package/{src/DateTimeFormat → DateTimeFormat}/ToDateTimeOptions.d.ts +1 -1
- package/DateTimeFormat/ToDateTimeOptions.d.ts.map +1 -0
- package/{src/DateTimeFormat → DateTimeFormat}/ToDateTimeOptions.js +1 -1
- package/{lib/src/DateTimeFormat → DateTimeFormat}/ToLocalTime.d.ts +5 -4
- package/DateTimeFormat/ToLocalTime.d.ts.map +1 -0
- package/{src/DateTimeFormat → DateTimeFormat}/ToLocalTime.js +1 -1
- package/DateTimeFormat/skeleton.d.ts +14 -0
- package/DateTimeFormat/skeleton.d.ts.map +1 -0
- package/{src/DateTimeFormat → DateTimeFormat}/skeleton.js +160 -29
- package/{lib/src/DateTimeFormat → DateTimeFormat}/utils.d.ts +1 -1
- package/DateTimeFormat/utils.d.ts.map +1 -0
- package/{src/DateTimeFormat → DateTimeFormat}/utils.js +0 -0
- package/{lib/src/DefaultNumberOption.d.ts → DefaultNumberOption.d.ts} +0 -0
- package/DefaultNumberOption.d.ts.map +1 -0
- package/{src/DefaultNumberOption.js → DefaultNumberOption.js} +0 -0
- package/{lib/src/DisplayNames → DisplayNames}/CanonicalCodeForDisplayNames.d.ts +0 -0
- package/DisplayNames/CanonicalCodeForDisplayNames.d.ts.map +1 -0
- package/{src/DisplayNames → DisplayNames}/CanonicalCodeForDisplayNames.js +0 -0
- package/{lib/src/GetNumberOption.d.ts → GetNumberOption.d.ts} +0 -0
- package/GetNumberOption.d.ts.map +1 -0
- package/{src/GetNumberOption.js → GetNumberOption.js} +0 -0
- package/{lib/src/GetOption.d.ts → GetOption.d.ts} +0 -0
- package/GetOption.d.ts.map +1 -0
- package/{src/GetOption.js → GetOption.js} +1 -1
- package/{lib/src/IsSanctionedSimpleUnitIdentifier.d.ts → IsSanctionedSimpleUnitIdentifier.d.ts} +0 -0
- package/IsSanctionedSimpleUnitIdentifier.d.ts.map +1 -0
- package/{src/IsSanctionedSimpleUnitIdentifier.js → IsSanctionedSimpleUnitIdentifier.js} +0 -0
- package/{lib/src/IsValidTimeZoneName.d.ts → IsValidTimeZoneName.d.ts} +0 -0
- package/IsValidTimeZoneName.d.ts.map +1 -0
- package/{src/IsValidTimeZoneName.js → IsValidTimeZoneName.js} +0 -0
- package/{lib/src/IsWellFormedCurrencyCode.d.ts → IsWellFormedCurrencyCode.d.ts} +0 -0
- package/IsWellFormedCurrencyCode.d.ts.map +1 -0
- package/{src/IsWellFormedCurrencyCode.js → IsWellFormedCurrencyCode.js} +0 -0
- package/{lib/src/IsWellFormedUnitIdentifier.d.ts → IsWellFormedUnitIdentifier.d.ts} +0 -0
- package/IsWellFormedUnitIdentifier.d.ts.map +1 -0
- package/{src/IsWellFormedUnitIdentifier.js → IsWellFormedUnitIdentifier.js} +0 -0
- package/{src/LookupMatcher.d.ts → LookupMatcher.d.ts} +1 -1
- package/LookupMatcher.d.ts.map +1 -0
- package/{src/LookupMatcher.js → LookupMatcher.js} +0 -0
- package/{lib/src/LookupSupportedLocales.d.ts → LookupSupportedLocales.d.ts} +0 -0
- package/LookupSupportedLocales.d.ts.map +1 -0
- package/{src/LookupSupportedLocales.js → LookupSupportedLocales.js} +0 -0
- package/{lib/src/NumberFormat → NumberFormat}/ComputeExponent.d.ts +1 -1
- package/NumberFormat/ComputeExponent.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/ComputeExponent.js +0 -0
- package/{src/NumberFormat → NumberFormat}/ComputeExponentForMagnitude.d.ts +1 -1
- package/NumberFormat/ComputeExponentForMagnitude.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/ComputeExponentForMagnitude.js +0 -0
- package/{lib/src/NumberFormat → NumberFormat}/CurrencyDigits.d.ts +0 -0
- package/NumberFormat/CurrencyDigits.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/CurrencyDigits.js +1 -1
- package/{src/NumberFormat → NumberFormat}/FormatNumericToParts.d.ts +1 -1
- package/NumberFormat/FormatNumericToParts.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/FormatNumericToParts.js +1 -1
- package/{src/NumberFormat → NumberFormat}/FormatNumericToString.d.ts +1 -1
- package/NumberFormat/FormatNumericToString.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/FormatNumericToString.js +1 -1
- package/{src/NumberFormat → NumberFormat}/InitializeNumberFormat.d.ts +1 -1
- package/NumberFormat/InitializeNumberFormat.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/InitializeNumberFormat.js +1 -1
- package/{src/NumberFormat → NumberFormat}/PartitionNumberPattern.d.ts +2 -2
- package/NumberFormat/PartitionNumberPattern.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/PartitionNumberPattern.js +1 -1
- package/{lib/src/NumberFormat → NumberFormat}/SetNumberFormatDigitOptions.d.ts +1 -1
- package/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/SetNumberFormatDigitOptions.js +0 -0
- package/{lib/src/NumberFormat → NumberFormat}/SetNumberFormatUnitOptions.d.ts +1 -1
- package/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/SetNumberFormatUnitOptions.js +0 -0
- package/{lib/src/NumberFormat → NumberFormat}/ToRawFixed.d.ts +1 -1
- package/NumberFormat/ToRawFixed.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/ToRawFixed.js +0 -0
- package/{lib/src/NumberFormat → NumberFormat}/ToRawPrecision.d.ts +1 -1
- package/NumberFormat/ToRawPrecision.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/ToRawPrecision.js +0 -0
- package/{lib/src/NumberFormat → NumberFormat}/digit-mapping.json +0 -0
- package/{lib/src/NumberFormat → NumberFormat}/format_to_parts.d.ts +1 -1
- package/NumberFormat/format_to_parts.d.ts.map +1 -0
- package/{src/NumberFormat → NumberFormat}/format_to_parts.js +0 -0
- package/PartitionPattern.d.ts +9 -0
- package/PartitionPattern.d.ts.map +1 -0
- package/{src/PartitionPattern.js → PartitionPattern.js} +0 -0
- package/{lib/src/PluralRules → PluralRules}/GetOperands.d.ts +0 -0
- package/PluralRules/GetOperands.d.ts.map +1 -0
- package/{src/PluralRules → PluralRules}/GetOperands.js +1 -1
- package/{lib/src/PluralRules → PluralRules}/InitializePluralRules.d.ts +1 -1
- package/PluralRules/InitializePluralRules.d.ts.map +1 -0
- package/{src/PluralRules → PluralRules}/InitializePluralRules.js +1 -1
- package/{lib/src/PluralRules → PluralRules}/ResolvePlural.d.ts +1 -1
- package/PluralRules/ResolvePlural.d.ts.map +1 -0
- package/{src/PluralRules → PluralRules}/ResolvePlural.js +1 -1
- package/README.md +4 -2
- package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTime.d.ts +1 -1
- package/RelativeTimeFormat/FormatRelativeTime.d.ts.map +1 -0
- package/{src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTime.js +0 -0
- package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTimeToParts.d.ts +1 -1
- package/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts.map +1 -0
- package/{src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTimeToParts.js +1 -1
- package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/InitializeRelativeTimeFormat.d.ts +1 -1
- package/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts.map +1 -0
- package/{src/RelativeTimeFormat → RelativeTimeFormat}/InitializeRelativeTimeFormat.js +1 -1
- package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/MakePartsList.d.ts +1 -1
- package/RelativeTimeFormat/MakePartsList.d.ts.map +1 -0
- package/{src/RelativeTimeFormat → RelativeTimeFormat}/MakePartsList.js +0 -0
- package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/PartitionRelativeTimePattern.d.ts +1 -1
- package/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts.map +1 -0
- package/{src/RelativeTimeFormat → RelativeTimeFormat}/PartitionRelativeTimePattern.js +1 -1
- package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/SingularRelativeTimeUnit.d.ts +1 -1
- package/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts.map +1 -0
- package/{src/RelativeTimeFormat → RelativeTimeFormat}/SingularRelativeTimeUnit.js +1 -1
- package/{lib/src/ResolveLocale.d.ts → ResolveLocale.d.ts} +0 -0
- package/ResolveLocale.d.ts.map +1 -0
- package/{src/ResolveLocale.js → ResolveLocale.js} +0 -0
- package/{lib/src/SupportedLocales.d.ts → SupportedLocales.d.ts} +0 -0
- package/SupportedLocales.d.ts.map +1 -0
- package/{src/SupportedLocales.js → SupportedLocales.js} +1 -1
- package/{lib/src/UnicodeExtensionValue.d.ts → UnicodeExtensionValue.d.ts} +0 -0
- package/UnicodeExtensionValue.d.ts.map +1 -0
- package/{src/UnicodeExtensionValue.js → UnicodeExtensionValue.js} +0 -0
- package/{lib/src/data.d.ts → data.d.ts} +1 -1
- package/data.d.ts.map +1 -0
- package/{src/data.js → data.js} +0 -0
- package/index.d.ts +48 -46
- package/index.d.ts.map +1 -1
- package/index.js +48 -46
- package/{src → lib}/BestAvailableLocale.d.ts +0 -0
- package/lib/BestAvailableLocale.d.ts.map +1 -0
- package/lib/{src/BestAvailableLocale.js → BestAvailableLocale.js} +0 -0
- package/lib/{src/BestFitMatcher.d.ts → BestFitMatcher.d.ts} +1 -1
- package/lib/BestFitMatcher.d.ts.map +1 -0
- package/lib/{src/BestFitMatcher.js → BestFitMatcher.js} +0 -0
- package/{src → lib}/CanonicalizeLocaleList.d.ts +0 -0
- package/lib/CanonicalizeLocaleList.d.ts.map +1 -0
- package/lib/{src/CanonicalizeLocaleList.js → CanonicalizeLocaleList.js} +0 -0
- package/{src → lib}/CanonicalizeTimeZoneName.d.ts +0 -0
- package/lib/CanonicalizeTimeZoneName.d.ts.map +1 -0
- package/lib/{src/CanonicalizeTimeZoneName.js → CanonicalizeTimeZoneName.js} +0 -0
- package/{src → lib}/DateTimeFormat/BasicFormatMatcher.d.ts +1 -1
- package/lib/DateTimeFormat/BasicFormatMatcher.d.ts.map +1 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/BasicFormatMatcher.js +0 -0
- package/{src → lib}/DateTimeFormat/BestFitFormatMatcher.d.ts +1 -1
- package/lib/DateTimeFormat/BestFitFormatMatcher.d.ts.map +1 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/BestFitFormatMatcher.js +10 -3
- package/{src → lib}/DateTimeFormat/DateTimeStyleFormat.d.ts +1 -1
- package/lib/DateTimeFormat/DateTimeStyleFormat.d.ts.map +1 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/DateTimeStyleFormat.js +0 -0
- package/{src → lib}/DateTimeFormat/FormatDateTime.d.ts +0 -0
- package/lib/DateTimeFormat/FormatDateTime.d.ts.map +1 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/FormatDateTime.js +0 -0
- package/lib/DateTimeFormat/FormatDateTimePattern.d.ts +14 -0
- package/lib/DateTimeFormat/FormatDateTimePattern.d.ts.map +1 -0
- package/lib/{src/DateTimeFormat/PartitionDateTimePattern.js → DateTimeFormat/FormatDateTimePattern.js} +2 -14
- package/lib/DateTimeFormat/FormatDateTimeRange.d.ts +4 -0
- package/lib/DateTimeFormat/FormatDateTimeRange.d.ts.map +1 -0
- package/lib/DateTimeFormat/FormatDateTimeRange.js +10 -0
- package/lib/DateTimeFormat/FormatDateTimeRangeToParts.d.ts +4 -0
- package/lib/DateTimeFormat/FormatDateTimeRangeToParts.d.ts.map +1 -0
- package/lib/DateTimeFormat/FormatDateTimeRangeToParts.js +14 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/FormatDateTimeToParts.d.ts +2 -1
- package/lib/DateTimeFormat/FormatDateTimeToParts.d.ts.map +1 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/FormatDateTimeToParts.js +1 -1
- package/{src → lib}/DateTimeFormat/InitializeDateTimeFormat.d.ts +1 -1
- package/lib/DateTimeFormat/InitializeDateTimeFormat.d.ts.map +1 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/InitializeDateTimeFormat.js +39 -27
- package/lib/DateTimeFormat/PartitionDateTimePattern.d.ts +10 -0
- package/lib/DateTimeFormat/PartitionDateTimePattern.d.ts.map +1 -0
- package/lib/DateTimeFormat/PartitionDateTimePattern.js +20 -0
- package/lib/DateTimeFormat/PartitionDateTimeRangePattern.d.ts +5 -0
- package/lib/DateTimeFormat/PartitionDateTimeRangePattern.d.ts.map +1 -0
- package/lib/DateTimeFormat/PartitionDateTimeRangePattern.js +99 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/ToDateTimeOptions.d.ts +1 -1
- package/lib/DateTimeFormat/ToDateTimeOptions.d.ts.map +1 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/ToDateTimeOptions.js +1 -1
- package/{src → lib}/DateTimeFormat/ToLocalTime.d.ts +5 -4
- package/lib/DateTimeFormat/ToLocalTime.d.ts.map +1 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/ToLocalTime.js +1 -1
- package/lib/DateTimeFormat/skeleton.d.ts +14 -0
- package/lib/DateTimeFormat/skeleton.d.ts.map +1 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/skeleton.js +156 -28
- package/{src → lib}/DateTimeFormat/utils.d.ts +1 -1
- package/lib/DateTimeFormat/utils.d.ts.map +1 -0
- package/lib/{src/DateTimeFormat → DateTimeFormat}/utils.js +0 -0
- package/{src → lib}/DefaultNumberOption.d.ts +0 -0
- package/lib/DefaultNumberOption.d.ts.map +1 -0
- package/lib/{src/DefaultNumberOption.js → DefaultNumberOption.js} +0 -0
- package/{src → lib}/DisplayNames/CanonicalCodeForDisplayNames.d.ts +0 -0
- package/lib/DisplayNames/CanonicalCodeForDisplayNames.d.ts.map +1 -0
- package/lib/{src/DisplayNames → DisplayNames}/CanonicalCodeForDisplayNames.js +0 -0
- package/{src → lib}/GetNumberOption.d.ts +0 -0
- package/lib/GetNumberOption.d.ts.map +1 -0
- package/lib/{src/GetNumberOption.js → GetNumberOption.js} +0 -0
- package/{src → lib}/GetOption.d.ts +0 -0
- package/lib/GetOption.d.ts.map +1 -0
- package/lib/{src/GetOption.js → GetOption.js} +1 -1
- package/{src → lib}/IsSanctionedSimpleUnitIdentifier.d.ts +0 -0
- package/lib/IsSanctionedSimpleUnitIdentifier.d.ts.map +1 -0
- package/lib/{src/IsSanctionedSimpleUnitIdentifier.js → IsSanctionedSimpleUnitIdentifier.js} +0 -0
- package/{src → lib}/IsValidTimeZoneName.d.ts +0 -0
- package/lib/IsValidTimeZoneName.d.ts.map +1 -0
- package/lib/{src/IsValidTimeZoneName.js → IsValidTimeZoneName.js} +0 -0
- package/{src → lib}/IsWellFormedCurrencyCode.d.ts +0 -0
- package/lib/IsWellFormedCurrencyCode.d.ts.map +1 -0
- package/lib/{src/IsWellFormedCurrencyCode.js → IsWellFormedCurrencyCode.js} +0 -0
- package/{src → lib}/IsWellFormedUnitIdentifier.d.ts +0 -0
- package/lib/IsWellFormedUnitIdentifier.d.ts.map +1 -0
- package/lib/{src/IsWellFormedUnitIdentifier.js → IsWellFormedUnitIdentifier.js} +0 -0
- package/lib/{src/LookupMatcher.d.ts → LookupMatcher.d.ts} +1 -1
- package/lib/LookupMatcher.d.ts.map +1 -0
- package/lib/{src/LookupMatcher.js → LookupMatcher.js} +0 -0
- package/{src → lib}/LookupSupportedLocales.d.ts +0 -0
- package/lib/LookupSupportedLocales.d.ts.map +1 -0
- package/lib/{src/LookupSupportedLocales.js → LookupSupportedLocales.js} +0 -0
- package/{src → lib}/NumberFormat/ComputeExponent.d.ts +1 -1
- package/lib/NumberFormat/ComputeExponent.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/ComputeExponent.js +0 -0
- package/lib/{src/NumberFormat → NumberFormat}/ComputeExponentForMagnitude.d.ts +1 -1
- package/lib/NumberFormat/ComputeExponentForMagnitude.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/ComputeExponentForMagnitude.js +0 -0
- package/{src → lib}/NumberFormat/CurrencyDigits.d.ts +0 -0
- package/lib/NumberFormat/CurrencyDigits.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/CurrencyDigits.js +1 -1
- package/lib/{src/NumberFormat → NumberFormat}/FormatNumericToParts.d.ts +1 -1
- package/lib/NumberFormat/FormatNumericToParts.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/FormatNumericToParts.js +1 -1
- package/lib/{src/NumberFormat → NumberFormat}/FormatNumericToString.d.ts +1 -1
- package/lib/NumberFormat/FormatNumericToString.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/FormatNumericToString.js +1 -1
- package/lib/{src/NumberFormat → NumberFormat}/InitializeNumberFormat.d.ts +1 -1
- package/lib/NumberFormat/InitializeNumberFormat.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/InitializeNumberFormat.js +1 -1
- package/lib/{src/NumberFormat → NumberFormat}/PartitionNumberPattern.d.ts +2 -2
- package/lib/NumberFormat/PartitionNumberPattern.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/PartitionNumberPattern.js +1 -1
- package/{src → lib}/NumberFormat/SetNumberFormatDigitOptions.d.ts +1 -1
- package/lib/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/SetNumberFormatDigitOptions.js +0 -0
- package/{src → lib}/NumberFormat/SetNumberFormatUnitOptions.d.ts +1 -1
- package/lib/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/SetNumberFormatUnitOptions.js +0 -0
- package/{src → lib}/NumberFormat/ToRawFixed.d.ts +1 -1
- package/lib/NumberFormat/ToRawFixed.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/ToRawFixed.js +0 -0
- package/{src → lib}/NumberFormat/ToRawPrecision.d.ts +1 -1
- package/lib/NumberFormat/ToRawPrecision.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/ToRawPrecision.js +0 -0
- package/{src → lib}/NumberFormat/digit-mapping.json +0 -0
- package/{src → lib}/NumberFormat/format_to_parts.d.ts +1 -1
- package/lib/NumberFormat/format_to_parts.d.ts.map +1 -0
- package/lib/{src/NumberFormat → NumberFormat}/format_to_parts.js +0 -0
- package/lib/PartitionPattern.d.ts +9 -0
- package/lib/PartitionPattern.d.ts.map +1 -0
- package/lib/{src/PartitionPattern.js → PartitionPattern.js} +0 -0
- package/{src → lib}/PluralRules/GetOperands.d.ts +0 -0
- package/lib/PluralRules/GetOperands.d.ts.map +1 -0
- package/lib/{src/PluralRules → PluralRules}/GetOperands.js +1 -1
- package/{src → lib}/PluralRules/InitializePluralRules.d.ts +1 -1
- package/lib/PluralRules/InitializePluralRules.d.ts.map +1 -0
- package/lib/{src/PluralRules → PluralRules}/InitializePluralRules.js +1 -1
- package/{src → lib}/PluralRules/ResolvePlural.d.ts +1 -1
- package/lib/PluralRules/ResolvePlural.d.ts.map +1 -0
- package/lib/{src/PluralRules → PluralRules}/ResolvePlural.js +1 -1
- package/{src → lib}/RelativeTimeFormat/FormatRelativeTime.d.ts +1 -1
- package/lib/RelativeTimeFormat/FormatRelativeTime.d.ts.map +1 -0
- package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTime.js +0 -0
- package/{src → lib}/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts +1 -1
- package/lib/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts.map +1 -0
- package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTimeToParts.js +1 -1
- package/{src → lib}/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts +1 -1
- package/lib/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts.map +1 -0
- package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/InitializeRelativeTimeFormat.js +1 -1
- package/{src → lib}/RelativeTimeFormat/MakePartsList.d.ts +1 -1
- package/lib/RelativeTimeFormat/MakePartsList.d.ts.map +1 -0
- package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/MakePartsList.js +0 -0
- package/{src → lib}/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts +1 -1
- package/lib/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts.map +1 -0
- package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/PartitionRelativeTimePattern.js +1 -1
- package/{src → lib}/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts +1 -1
- package/lib/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts.map +1 -0
- package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/SingularRelativeTimeUnit.js +1 -1
- package/{src → lib}/ResolveLocale.d.ts +0 -0
- package/lib/ResolveLocale.d.ts.map +1 -0
- package/lib/{src/ResolveLocale.js → ResolveLocale.js} +0 -0
- package/{src → lib}/SupportedLocales.d.ts +0 -0
- package/lib/SupportedLocales.d.ts.map +1 -0
- package/lib/{src/SupportedLocales.js → SupportedLocales.js} +1 -1
- package/{src → lib}/UnicodeExtensionValue.d.ts +0 -0
- package/lib/UnicodeExtensionValue.d.ts.map +1 -0
- package/lib/{src/UnicodeExtensionValue.js → UnicodeExtensionValue.js} +0 -0
- package/{src → lib}/data.d.ts +1 -1
- package/lib/data.d.ts.map +1 -0
- package/lib/{src/data.js → data.js} +0 -0
- package/lib/index.d.ts +48 -46
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +48 -46
- package/lib/types/date-time.d.ts +29 -0
- package/lib/types/date-time.d.ts.map +1 -1
- package/lib/types/date-time.js +6 -1
- package/lib/types/relative-time.d.ts +1 -1
- package/lib/types/relative-time.d.ts.map +1 -1
- package/lib/{src/utils.d.ts → utils.d.ts} +0 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/{src/utils.js → utils.js} +0 -0
- package/package.json +1 -1
- package/types/date-time.d.ts +29 -0
- package/types/date-time.d.ts.map +1 -1
- package/types/date-time.js +7 -0
- package/types/relative-time.d.ts +1 -1
- package/types/relative-time.d.ts.map +1 -1
- package/{src/utils.d.ts → utils.d.ts} +0 -0
- package/utils.d.ts.map +1 -0
- package/{src/utils.js → utils.js} +0 -0
- package/_validate_dist-base_options.optionsvalid.d.ts +0 -9
- package/_validate_dist-esm_options.optionsvalid.d.ts +0 -9
- package/lib/src/BestAvailableLocale.d.ts.map +0 -1
- package/lib/src/BestFitMatcher.d.ts.map +0 -1
- package/lib/src/CanonicalizeLocaleList.d.ts.map +0 -1
- package/lib/src/CanonicalizeTimeZoneName.d.ts.map +0 -1
- package/lib/src/DateTimeFormat/BasicFormatMatcher.d.ts.map +0 -1
- package/lib/src/DateTimeFormat/BestFitFormatMatcher.d.ts.map +0 -1
- package/lib/src/DateTimeFormat/DateTimeStyleFormat.d.ts.map +0 -1
- package/lib/src/DateTimeFormat/FormatDateTime.d.ts.map +0 -1
- package/lib/src/DateTimeFormat/FormatDateTimeToParts.d.ts.map +0 -1
- package/lib/src/DateTimeFormat/InitializeDateTimeFormat.d.ts.map +0 -1
- package/lib/src/DateTimeFormat/PartitionDateTimePattern.d.ts +0 -13
- package/lib/src/DateTimeFormat/PartitionDateTimePattern.d.ts.map +0 -1
- package/lib/src/DateTimeFormat/ToDateTimeOptions.d.ts.map +0 -1
- package/lib/src/DateTimeFormat/ToLocalTime.d.ts.map +0 -1
- package/lib/src/DateTimeFormat/skeleton.d.ts +0 -9
- package/lib/src/DateTimeFormat/skeleton.d.ts.map +0 -1
- package/lib/src/DateTimeFormat/utils.d.ts.map +0 -1
- package/lib/src/DefaultNumberOption.d.ts.map +0 -1
- package/lib/src/DisplayNames/CanonicalCodeForDisplayNames.d.ts.map +0 -1
- package/lib/src/GetNumberOption.d.ts.map +0 -1
- package/lib/src/GetOption.d.ts.map +0 -1
- package/lib/src/IsSanctionedSimpleUnitIdentifier.d.ts.map +0 -1
- package/lib/src/IsValidTimeZoneName.d.ts.map +0 -1
- package/lib/src/IsWellFormedCurrencyCode.d.ts.map +0 -1
- package/lib/src/IsWellFormedUnitIdentifier.d.ts.map +0 -1
- package/lib/src/LookupMatcher.d.ts.map +0 -1
- package/lib/src/LookupSupportedLocales.d.ts.map +0 -1
- package/lib/src/NumberFormat/ComputeExponent.d.ts.map +0 -1
- package/lib/src/NumberFormat/ComputeExponentForMagnitude.d.ts.map +0 -1
- package/lib/src/NumberFormat/CurrencyDigits.d.ts.map +0 -1
- package/lib/src/NumberFormat/FormatNumericToParts.d.ts.map +0 -1
- package/lib/src/NumberFormat/FormatNumericToString.d.ts.map +0 -1
- package/lib/src/NumberFormat/InitializeNumberFormat.d.ts.map +0 -1
- package/lib/src/NumberFormat/PartitionNumberPattern.d.ts.map +0 -1
- package/lib/src/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +0 -1
- package/lib/src/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +0 -1
- package/lib/src/NumberFormat/ToRawFixed.d.ts.map +0 -1
- package/lib/src/NumberFormat/ToRawPrecision.d.ts.map +0 -1
- package/lib/src/NumberFormat/format_to_parts.d.ts.map +0 -1
- package/lib/src/PartitionPattern.d.ts +0 -12
- package/lib/src/PartitionPattern.d.ts.map +0 -1
- package/lib/src/PluralRules/GetOperands.d.ts.map +0 -1
- package/lib/src/PluralRules/InitializePluralRules.d.ts.map +0 -1
- package/lib/src/PluralRules/ResolvePlural.d.ts.map +0 -1
- package/lib/src/RelativeTimeFormat/FormatRelativeTime.d.ts.map +0 -1
- package/lib/src/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts.map +0 -1
- package/lib/src/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts.map +0 -1
- package/lib/src/RelativeTimeFormat/MakePartsList.d.ts.map +0 -1
- package/lib/src/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts.map +0 -1
- package/lib/src/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts.map +0 -1
- package/lib/src/ResolveLocale.d.ts.map +0 -1
- package/lib/src/SupportedLocales.d.ts.map +0 -1
- package/lib/src/UnicodeExtensionValue.d.ts.map +0 -1
- package/lib/src/data.d.ts.map +0 -1
- package/lib/src/utils.d.ts.map +0 -1
- package/src/BestAvailableLocale.d.ts.map +0 -1
- package/src/BestFitMatcher.d.ts.map +0 -1
- package/src/CanonicalizeLocaleList.d.ts.map +0 -1
- package/src/CanonicalizeTimeZoneName.d.ts.map +0 -1
- package/src/DateTimeFormat/BasicFormatMatcher.d.ts.map +0 -1
- package/src/DateTimeFormat/BestFitFormatMatcher.d.ts.map +0 -1
- package/src/DateTimeFormat/DateTimeStyleFormat.d.ts.map +0 -1
- package/src/DateTimeFormat/FormatDateTime.d.ts.map +0 -1
- package/src/DateTimeFormat/FormatDateTimeToParts.d.ts.map +0 -1
- package/src/DateTimeFormat/InitializeDateTimeFormat.d.ts.map +0 -1
- package/src/DateTimeFormat/PartitionDateTimePattern.d.ts +0 -13
- package/src/DateTimeFormat/PartitionDateTimePattern.d.ts.map +0 -1
- package/src/DateTimeFormat/ToDateTimeOptions.d.ts.map +0 -1
- package/src/DateTimeFormat/ToLocalTime.d.ts.map +0 -1
- package/src/DateTimeFormat/skeleton.d.ts +0 -9
- package/src/DateTimeFormat/skeleton.d.ts.map +0 -1
- package/src/DateTimeFormat/utils.d.ts.map +0 -1
- package/src/DefaultNumberOption.d.ts.map +0 -1
- package/src/DisplayNames/CanonicalCodeForDisplayNames.d.ts.map +0 -1
- package/src/GetNumberOption.d.ts.map +0 -1
- package/src/GetOption.d.ts.map +0 -1
- package/src/IsSanctionedSimpleUnitIdentifier.d.ts.map +0 -1
- package/src/IsValidTimeZoneName.d.ts.map +0 -1
- package/src/IsWellFormedCurrencyCode.d.ts.map +0 -1
- package/src/IsWellFormedUnitIdentifier.d.ts.map +0 -1
- package/src/LookupMatcher.d.ts.map +0 -1
- package/src/LookupSupportedLocales.d.ts.map +0 -1
- package/src/NumberFormat/ComputeExponent.d.ts.map +0 -1
- package/src/NumberFormat/ComputeExponentForMagnitude.d.ts.map +0 -1
- package/src/NumberFormat/CurrencyDigits.d.ts.map +0 -1
- package/src/NumberFormat/FormatNumericToParts.d.ts.map +0 -1
- package/src/NumberFormat/FormatNumericToString.d.ts.map +0 -1
- package/src/NumberFormat/InitializeNumberFormat.d.ts.map +0 -1
- package/src/NumberFormat/PartitionNumberPattern.d.ts.map +0 -1
- package/src/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +0 -1
- package/src/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +0 -1
- package/src/NumberFormat/ToRawFixed.d.ts.map +0 -1
- package/src/NumberFormat/ToRawPrecision.d.ts.map +0 -1
- package/src/NumberFormat/format_to_parts.d.ts.map +0 -1
- package/src/PartitionPattern.d.ts +0 -12
- package/src/PartitionPattern.d.ts.map +0 -1
- package/src/PluralRules/GetOperands.d.ts.map +0 -1
- package/src/PluralRules/InitializePluralRules.d.ts.map +0 -1
- package/src/PluralRules/ResolvePlural.d.ts.map +0 -1
- package/src/RelativeTimeFormat/FormatRelativeTime.d.ts.map +0 -1
- package/src/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts.map +0 -1
- package/src/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts.map +0 -1
- package/src/RelativeTimeFormat/MakePartsList.d.ts.map +0 -1
- package/src/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts.map +0 -1
- package/src/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts.map +0 -1
- package/src/ResolveLocale.d.ts.map +0 -1
- package/src/SupportedLocales.d.ts.map +0 -1
- package/src/UnicodeExtensionValue.d.ts.map +0 -1
- package/src/data.d.ts.map +0 -1
- package/src/utils.d.ts.map +0 -1
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BestAvailableLocale.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/BestAvailableLocale.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,MAAM,EAAE,EAC1B,MAAM,EAAE,MAAM,sBAgBf"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BestFitMatcher.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/BestFitMatcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAGjD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,MAAM,EAAE,EAC1B,gBAAgB,EAAE,MAAM,EAAE,EAC1B,gBAAgB,EAAE,MAAM,MAAM,GAC7B,mBAAmB,CAwBrB"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanonicalizeLocaleList.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/CanonicalizeLocaleList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,OAGjE"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanonicalizeTimeZoneName.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/CanonicalizeTimeZoneName.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,MAAM,EACV,EACE,MAAM,EACN,cAAc,GACf,EAAE;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,UAgBF"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasicFormatMatcher.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/BasicFormatMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAYlE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,OAAO,EAAE,GACjB,OAAO,CAsCT"}
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateTimeFormatOptions, Formats } from '
|
|
1
|
+
import { DateTimeFormatOptions, Formats } from '../types/date-time';
|
|
2
2
|
/**
|
|
3
3
|
* Credit: https://github.com/andyearnshaw/Intl.js/blob/0958dc1ad8153f1056653ea22b8208f0df289a4e/src/12.datetimeformat.js#L611
|
|
4
4
|
* with some modifications
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BestFitFormatMatcher.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/BestFitFormatMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,OAAO,EAAU,MAAM,oBAAoB,CAAC;AAoB3E;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,OAAO,GACd,MAAM,CA0CR;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,OAAO,EAAE,WAsDnB"}
|
|
@@ -81,10 +81,11 @@ function BestFitFormatMatcher(options, formats) {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
var skeletonFormat = tslib_1.__assign({}, bestFormat);
|
|
84
|
-
var patternFormat =
|
|
84
|
+
var patternFormat = { rawPattern: bestFormat.rawPattern };
|
|
85
|
+
skeleton_1.processDateTimePattern(bestFormat.rawPattern, patternFormat);
|
|
85
86
|
// Kinda following https://github.com/unicode-org/icu/blob/dd50e38f459d84e9bf1b0c618be8483d318458ad/icu4j/main/classes/core/src/com/ibm/icu/text/DateTimePatternGenerator.java
|
|
86
87
|
// Method adjustFieldTypes
|
|
87
|
-
for (var prop in
|
|
88
|
+
for (var prop in skeletonFormat) {
|
|
88
89
|
var skeletonValue = skeletonFormat[prop];
|
|
89
90
|
var patternValue = patternFormat[prop];
|
|
90
91
|
var requestedValue = options[prop];
|
|
@@ -109,6 +110,12 @@ function BestFitFormatMatcher(options, formats) {
|
|
|
109
110
|
}
|
|
110
111
|
patternFormat[prop] = requestedValue;
|
|
111
112
|
}
|
|
113
|
+
// Copy those over
|
|
114
|
+
patternFormat.pattern = skeletonFormat.pattern;
|
|
115
|
+
patternFormat.pattern12 = skeletonFormat.pattern12;
|
|
116
|
+
patternFormat.skeleton = skeletonFormat.skeleton;
|
|
117
|
+
patternFormat.rangePatterns = skeletonFormat.rangePatterns;
|
|
118
|
+
patternFormat.rangePatterns12 = skeletonFormat.rangePatterns12;
|
|
112
119
|
return patternFormat;
|
|
113
120
|
}
|
|
114
121
|
exports.BestFitFormatMatcher = BestFitFormatMatcher;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DateTimeFormatOptions, DateTimeFormatLocaleInternalData, Formats } from '
|
|
1
|
+
import { DateTimeFormatOptions, DateTimeFormatLocaleInternalData, Formats } from '../types/date-time';
|
|
2
2
|
export declare function DateTimeStyleFormat(dateStyle: DateTimeFormatOptions['dateStyle'], timeStyle: DateTimeFormatOptions['timeStyle'], dataLocaleData: DateTimeFormatLocaleInternalData): Formats;
|
|
3
3
|
//# sourceMappingURL=DateTimeStyleFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimeStyleFormat.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/DateTimeStyleFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gCAAgC,EAChC,OAAO,EACR,MAAM,oBAAoB,CAAC;AAG5B,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,qBAAqB,CAAC,WAAW,CAAC,EAC7C,SAAS,EAAE,qBAAqB,CAAC,WAAW,CAAC,EAC7C,cAAc,EAAE,gCAAgC,GAC/C,OAAO,CAuDT"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormatDateTime.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/FormatDateTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAEpE;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,UAQ5D"}
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IntlDateTimeFormatInternal, DateTimeFormatLocaleInternalData, IntlDateTimeFormatPart } from '../types/date-time';
|
|
2
|
+
import { ToLocalTimeImplDetails } from './ToLocalTime';
|
|
3
|
+
export interface FormatDateTimePatternImplDetails {
|
|
4
|
+
getInternalSlots(dtf: Intl.DateTimeFormat): IntlDateTimeFormatInternal;
|
|
5
|
+
localeData: Record<string, DateTimeFormatLocaleInternalData>;
|
|
6
|
+
getDefaultTimeZone(): string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* https://tc39.es/ecma402/#sec-partitiondatetimepattern
|
|
10
|
+
* @param dtf
|
|
11
|
+
* @param x
|
|
12
|
+
*/
|
|
13
|
+
export declare function FormatDateTimePattern(dtf: Intl.DateTimeFormat, patternParts: IntlDateTimeFormatPart[], x: number, { getInternalSlots, localeData, getDefaultTimeZone, tzData, }: FormatDateTimePatternImplDetails & ToLocalTimeImplDetails): IntlDateTimeFormatPart[];
|
|
14
|
+
//# sourceMappingURL=FormatDateTimePattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormatDateTimePattern.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/FormatDateTimePattern.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAChC,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAc,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAyClE,MAAM,WAAW,gCAAgC;IAC/C,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,0BAA0B,CAAC;IACvE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC;IAC7D,kBAAkB,IAAI,MAAM,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,YAAY,EAAE,sBAAsB,EAAE,EACtC,CAAC,EAAE,MAAM,EACT,EACE,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,MAAM,GACP,EAAE,gCAAgC,GAAG,sBAAsB,GAC3D,sBAAsB,EAAE,CAiI1B"}
|
package/{src/DateTimeFormat/PartitionDateTimePattern.js → DateTimeFormat/FormatDateTimePattern.js}
RENAMED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var _262_1 = require("../../262");
|
|
5
|
-
var PartitionPattern_1 = require("../PartitionPattern");
|
|
3
|
+
exports.FormatDateTimePattern = void 0;
|
|
6
4
|
var utils_1 = require("./utils");
|
|
7
5
|
var ToLocalTime_1 = require("./ToLocalTime");
|
|
6
|
+
var _262_1 = require("../262");
|
|
8
7
|
function pad(n) {
|
|
9
8
|
if (n < 10) {
|
|
10
9
|
return "0" + n;
|
|
@@ -40,12 +39,9 @@ function offsetToGmtString(gmtFormat, hourFormat, offsetInMs, style) {
|
|
|
40
39
|
* @param dtf
|
|
41
40
|
* @param x
|
|
42
41
|
*/
|
|
43
|
-
function
|
|
42
|
+
function FormatDateTimePattern(dtf, patternParts, x, _a) {
|
|
44
43
|
var getInternalSlots = _a.getInternalSlots, localeData = _a.localeData, getDefaultTimeZone = _a.getDefaultTimeZone, tzData = _a.tzData;
|
|
45
44
|
x = _262_1.TimeClip(x);
|
|
46
|
-
if (isNaN(x)) {
|
|
47
|
-
throw new RangeError('invalid time');
|
|
48
|
-
}
|
|
49
45
|
/** IMPL START */
|
|
50
46
|
var internalSlots = getInternalSlots(dtf);
|
|
51
47
|
var dataLocale = internalSlots.dataLocale;
|
|
@@ -63,7 +59,6 @@ function PartitionDateTimePattern(dtf, x, _a) {
|
|
|
63
59
|
// @ts-ignore
|
|
64
60
|
internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });
|
|
65
61
|
var result = [];
|
|
66
|
-
var patternParts = PartitionPattern_1.PartitionPattern(internalSlots.pattern);
|
|
67
62
|
for (var _i = 0, patternParts_1 = patternParts; _i < patternParts_1.length; _i++) {
|
|
68
63
|
var patternPart = patternParts_1[_i];
|
|
69
64
|
var p = patternPart.type;
|
|
@@ -167,14 +162,7 @@ function PartitionDateTimePattern(dtf, x, _a) {
|
|
|
167
162
|
value: fv,
|
|
168
163
|
});
|
|
169
164
|
}
|
|
170
|
-
else {
|
|
171
|
-
result.push({
|
|
172
|
-
// @ts-ignore TODO: Fix TS type
|
|
173
|
-
type: 'unknown',
|
|
174
|
-
value: String(x),
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
165
|
}
|
|
178
166
|
return result;
|
|
179
167
|
}
|
|
180
|
-
exports.
|
|
168
|
+
exports.FormatDateTimePattern = FormatDateTimePattern;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FormatDateTimePatternImplDetails } from './FormatDateTimePattern';
|
|
2
|
+
import { ToLocalTimeImplDetails } from './ToLocalTime';
|
|
3
|
+
export declare function FormatDateTimeRange(dtf: Intl.DateTimeFormat, x: number, y: number, implDetails: FormatDateTimePatternImplDetails & ToLocalTimeImplDetails): string;
|
|
4
|
+
//# sourceMappingURL=FormatDateTimeRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormatDateTimeRange.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/FormatDateTimeRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gCAAgC,EAAC,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAErD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,gCAAgC,GAAG,sBAAsB,UAQvE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormatDateTimeRange = void 0;
|
|
4
|
+
var PartitionDateTimeRangePattern_1 = require("./PartitionDateTimeRangePattern");
|
|
5
|
+
function FormatDateTimeRange(dtf, x, y, implDetails) {
|
|
6
|
+
var parts = PartitionDateTimeRangePattern_1.PartitionDateTimeRangePattern(dtf, x, y, implDetails);
|
|
7
|
+
var result = '';
|
|
8
|
+
for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {
|
|
9
|
+
var part = parts_1[_i];
|
|
10
|
+
result += part.value;
|
|
11
|
+
}
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
exports.FormatDateTimeRange = FormatDateTimeRange;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FormatDateTimePatternImplDetails } from './FormatDateTimePattern';
|
|
2
|
+
import { ToLocalTimeImplDetails } from './ToLocalTime';
|
|
3
|
+
export declare function FormatDateTimeRangeToParts(dtf: Intl.DateTimeFormat, x: number, y: number, implDetails: FormatDateTimePatternImplDetails & ToLocalTimeImplDetails): any[];
|
|
4
|
+
//# sourceMappingURL=FormatDateTimeRangeToParts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormatDateTimeRangeToParts.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/FormatDateTimeRangeToParts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gCAAgC,EAAC,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAErD,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,gCAAgC,GAAG,sBAAsB,SAYvE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormatDateTimeRangeToParts = void 0;
|
|
4
|
+
var PartitionDateTimeRangePattern_1 = require("./PartitionDateTimeRangePattern");
|
|
5
|
+
function FormatDateTimeRangeToParts(dtf, x, y, implDetails) {
|
|
6
|
+
var parts = PartitionDateTimeRangePattern_1.PartitionDateTimeRangePattern(dtf, x, y, implDetails);
|
|
7
|
+
var result = new Array(0);
|
|
8
|
+
for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {
|
|
9
|
+
var part = parts_1[_i];
|
|
10
|
+
result.push({
|
|
11
|
+
type: part.type,
|
|
12
|
+
value: part.value,
|
|
13
|
+
source: part.source,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
exports.FormatDateTimeRangeToParts = FormatDateTimeRangeToParts;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PartitionDateTimePattern } from './PartitionDateTimePattern';
|
|
2
|
+
import { IntlDateTimeFormatPart } from '../types/date-time';
|
|
2
3
|
/**
|
|
3
4
|
* https://tc39.es/ecma402/#sec-formatdatetimetoparts
|
|
4
5
|
*
|
|
@@ -6,5 +7,5 @@ import { PartitionDateTimePattern } from './PartitionDateTimePattern';
|
|
|
6
7
|
* @param x
|
|
7
8
|
* @param implDetails
|
|
8
9
|
*/
|
|
9
|
-
export declare function FormatDateTimeToParts(dtf: Intl.DateTimeFormat, x: number, implDetails: Parameters<typeof PartitionDateTimePattern>[2]):
|
|
10
|
+
export declare function FormatDateTimeToParts(dtf: Intl.DateTimeFormat, x: number, implDetails: Parameters<typeof PartitionDateTimePattern>[2]): IntlDateTimeFormatPart[];
|
|
10
11
|
//# sourceMappingURL=FormatDateTimeToParts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormatDateTimeToParts.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/FormatDateTimeToParts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAEpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,oBAAoB,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,GAC1D,sBAAsB,EAAE,CAU1B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FormatDateTimeToParts = void 0;
|
|
4
4
|
var PartitionDateTimePattern_1 = require("./PartitionDateTimePattern");
|
|
5
|
-
var _262_1 = require("
|
|
5
|
+
var _262_1 = require("../262");
|
|
6
6
|
/**
|
|
7
7
|
* https://tc39.es/ecma402/#sec-formatdatetimetoparts
|
|
8
8
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateTimeFormatOptions, IntlDateTimeFormatInternal, DateTimeFormatLocaleInternalData } from '
|
|
1
|
+
import { DateTimeFormatOptions, IntlDateTimeFormatInternal, DateTimeFormatLocaleInternalData } from '../types/date-time';
|
|
2
2
|
/**
|
|
3
3
|
* https://tc39.es/ecma402/#sec-initializedatetimeformat
|
|
4
4
|
* @param dtf DateTimeFormat
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InitializeDateTimeFormat.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/InitializeDateTimeFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,0BAA0B,EAC1B,gCAAgC,EACjC,MAAM,oBAAoB,CAAC;AAuD5B;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EACtC,IAAI,EAAE,qBAAqB,GAAG,SAAS,EACvC,EACE,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,MAAM,EACN,cAAc,GACf,EAAE;IACD,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,0BAA0B,CAAC;IACvE,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,IAAI,MAAM,CAAC;IAC3B,kBAAkB,IAAI,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gCAAgC,GAAG,SAAS,CAAC,CAAC;IACzE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,GACA,IAAI,CAAC,cAAc,CA4OrB"}
|
|
@@ -22,6 +22,31 @@ function isTimeRelated(opt) {
|
|
|
22
22
|
}
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
25
|
+
function resolveHourCycle(hc, hcDefault, hour12) {
|
|
26
|
+
if (hc == null) {
|
|
27
|
+
hc = hcDefault;
|
|
28
|
+
}
|
|
29
|
+
if (hour12 !== undefined) {
|
|
30
|
+
if (hour12) {
|
|
31
|
+
if (hcDefault === 'h11' || hcDefault === 'h23') {
|
|
32
|
+
hc = 'h11';
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
hc = 'h12';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
utils_1.invariant(!hour12, 'hour12 must not be set');
|
|
40
|
+
if (hcDefault === 'h11' || hcDefault === 'h23') {
|
|
41
|
+
hc = 'h23';
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
hc = 'h24';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return hc;
|
|
49
|
+
}
|
|
25
50
|
var TYPE_REGEX = /^[a-z0-9]{3,8}$/i;
|
|
26
51
|
/**
|
|
27
52
|
* https://tc39.es/ecma402/#sec-initializedatetimeformat
|
|
@@ -103,11 +128,12 @@ function InitializeDateTimeFormat(dtf, locales, opts, _a) {
|
|
|
103
128
|
bestFormat = BasicFormatMatcher_1.BasicFormatMatcher(opt, formats);
|
|
104
129
|
}
|
|
105
130
|
else {
|
|
131
|
+
// IMPL DETAILS START
|
|
106
132
|
if (isTimeRelated(opt)) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
internalSlots.hourCycle === 'h12';
|
|
133
|
+
var hc = resolveHourCycle(internalSlots.hourCycle, dataLocaleData.hourCycle, hour12);
|
|
134
|
+
opt.hour12 = hc === 'h11' || hc === 'h12';
|
|
110
135
|
}
|
|
136
|
+
// IMPL DETAILS END
|
|
111
137
|
bestFormat = BestFitFormatMatcher_1.BestFitFormatMatcher(opt, formats);
|
|
112
138
|
}
|
|
113
139
|
}
|
|
@@ -121,6 +147,10 @@ function InitializeDateTimeFormat(dtf, locales, opts, _a) {
|
|
|
121
147
|
}
|
|
122
148
|
bestFormat = DateTimeStyleFormat_1.DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData);
|
|
123
149
|
}
|
|
150
|
+
// IMPL DETAIL START
|
|
151
|
+
// For debugging
|
|
152
|
+
internalSlots.format = bestFormat;
|
|
153
|
+
// IMPL DETAIL END
|
|
124
154
|
for (var prop in opt) {
|
|
125
155
|
var p = bestFormat[prop];
|
|
126
156
|
if (p !== undefined) {
|
|
@@ -128,45 +158,27 @@ function InitializeDateTimeFormat(dtf, locales, opts, _a) {
|
|
|
128
158
|
}
|
|
129
159
|
}
|
|
130
160
|
var pattern;
|
|
161
|
+
var rangePatterns;
|
|
131
162
|
if (internalSlots.hour !== undefined) {
|
|
132
|
-
var
|
|
133
|
-
var hc = internalSlots.hourCycle;
|
|
134
|
-
if (hc == null) {
|
|
135
|
-
hc = hcDefault;
|
|
136
|
-
}
|
|
137
|
-
if (hour12 !== undefined) {
|
|
138
|
-
if (hour12) {
|
|
139
|
-
if (hcDefault === 'h11' || hcDefault === 'h23') {
|
|
140
|
-
hc = 'h11';
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
hc = 'h12';
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
utils_1.invariant(!hour12, 'hour12 must not be set');
|
|
148
|
-
if (hcDefault === 'h11' || hcDefault === 'h23') {
|
|
149
|
-
hc = 'h23';
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
hc = 'h24';
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
163
|
+
var hc = resolveHourCycle(internalSlots.hourCycle, dataLocaleData.hourCycle, hour12);
|
|
156
164
|
internalSlots.hourCycle = hc;
|
|
157
165
|
if (hc === 'h11' || hc === 'h12') {
|
|
158
166
|
pattern = bestFormat.pattern12;
|
|
167
|
+
rangePatterns = bestFormat.rangePatterns12;
|
|
159
168
|
}
|
|
160
169
|
else {
|
|
161
170
|
pattern = bestFormat.pattern;
|
|
171
|
+
rangePatterns = bestFormat.rangePatterns;
|
|
162
172
|
}
|
|
163
173
|
}
|
|
164
174
|
else {
|
|
165
175
|
// @ts-ignore
|
|
166
176
|
internalSlots.hourCycle = undefined;
|
|
167
177
|
pattern = bestFormat.pattern;
|
|
178
|
+
rangePatterns = bestFormat.rangePatterns;
|
|
168
179
|
}
|
|
169
180
|
internalSlots.pattern = pattern;
|
|
181
|
+
internalSlots.rangePatterns = rangePatterns;
|
|
170
182
|
return dtf;
|
|
171
183
|
}
|
|
172
184
|
exports.InitializeDateTimeFormat = InitializeDateTimeFormat;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ToLocalTimeImplDetails } from './ToLocalTime';
|
|
2
|
+
import { FormatDateTimePatternImplDetails } from './FormatDateTimePattern';
|
|
3
|
+
import { IntlDateTimeFormatPart } from '../types/date-time';
|
|
4
|
+
/**
|
|
5
|
+
* https://tc39.es/ecma402/#sec-partitiondatetimepattern
|
|
6
|
+
* @param dtf
|
|
7
|
+
* @param x
|
|
8
|
+
*/
|
|
9
|
+
export declare function PartitionDateTimePattern(dtf: Intl.DateTimeFormat, x: number, implDetails: ToLocalTimeImplDetails & FormatDateTimePatternImplDetails): IntlDateTimeFormatPart[];
|
|
10
|
+
//# sourceMappingURL=PartitionDateTimePattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PartitionDateTimePattern.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/PartitionDateTimePattern.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAEL,gCAAgC,EACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,sBAAsB,GAAG,gCAAgC,GACrE,sBAAsB,EAAE,CAkB1B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PartitionDateTimePattern = void 0;
|
|
4
|
+
var _262_1 = require("../262");
|
|
5
|
+
var FormatDateTimePattern_1 = require("./FormatDateTimePattern");
|
|
6
|
+
var PartitionPattern_1 = require("../PartitionPattern");
|
|
7
|
+
/**
|
|
8
|
+
* https://tc39.es/ecma402/#sec-partitiondatetimepattern
|
|
9
|
+
* @param dtf
|
|
10
|
+
* @param x
|
|
11
|
+
*/
|
|
12
|
+
function PartitionDateTimePattern(dtf, x, implDetails) {
|
|
13
|
+
x = _262_1.TimeClip(x);
|
|
14
|
+
if (isNaN(x)) {
|
|
15
|
+
throw new RangeError('invalid time');
|
|
16
|
+
}
|
|
17
|
+
/** IMPL START */
|
|
18
|
+
var getInternalSlots = implDetails.getInternalSlots;
|
|
19
|
+
var internalSlots = getInternalSlots(dtf);
|
|
20
|
+
/** IMPL END */
|
|
21
|
+
var pattern = internalSlots.pattern;
|
|
22
|
+
return FormatDateTimePattern_1.FormatDateTimePattern(dtf, PartitionPattern_1.PartitionPattern(pattern), x, implDetails);
|
|
23
|
+
}
|
|
24
|
+
exports.PartitionDateTimePattern = PartitionDateTimePattern;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IntlDateTimeFormatPart } from '../types/date-time';
|
|
2
|
+
import { ToLocalTimeImplDetails } from './ToLocalTime';
|
|
3
|
+
import { FormatDateTimePatternImplDetails } from './FormatDateTimePattern';
|
|
4
|
+
export declare function PartitionDateTimeRangePattern(dtf: Intl.DateTimeFormat, x: number, y: number, implDetails: FormatDateTimePatternImplDetails & ToLocalTimeImplDetails): IntlDateTimeFormatPart[];
|
|
5
|
+
//# sourceMappingURL=PartitionDateTimeRangePattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PartitionDateTimeRangePattern.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/PartitionDateTimeRangePattern.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAIvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAc,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAClE,OAAO,EAEL,gCAAgC,EACjC,MAAM,yBAAyB,CAAC;AAcjC,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,gCAAgC,GAAG,sBAAsB,4BA+FvE"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PartitionDateTimeRangePattern = void 0;
|
|
4
|
+
var _262_1 = require("../262");
|
|
5
|
+
var ToLocalTime_1 = require("./ToLocalTime");
|
|
6
|
+
var FormatDateTimePattern_1 = require("./FormatDateTimePattern");
|
|
7
|
+
var PartitionPattern_1 = require("../PartitionPattern");
|
|
8
|
+
var TABLE_2_FIELDS = [
|
|
9
|
+
'era',
|
|
10
|
+
'year',
|
|
11
|
+
'month',
|
|
12
|
+
'day',
|
|
13
|
+
'ampm',
|
|
14
|
+
'hour',
|
|
15
|
+
'minute',
|
|
16
|
+
'second',
|
|
17
|
+
];
|
|
18
|
+
function PartitionDateTimeRangePattern(dtf, x, y, implDetails) {
|
|
19
|
+
x = _262_1.TimeClip(x);
|
|
20
|
+
if (isNaN(x)) {
|
|
21
|
+
throw new RangeError('Invalid start time');
|
|
22
|
+
}
|
|
23
|
+
y = _262_1.TimeClip(y);
|
|
24
|
+
if (isNaN(y)) {
|
|
25
|
+
throw new RangeError('Invalid end time');
|
|
26
|
+
}
|
|
27
|
+
/** IMPL START */
|
|
28
|
+
var getInternalSlots = implDetails.getInternalSlots, tzData = implDetails.tzData;
|
|
29
|
+
var internalSlots = getInternalSlots(dtf);
|
|
30
|
+
/** IMPL END */
|
|
31
|
+
var tm1 = ToLocalTime_1.ToLocalTime(x,
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });
|
|
34
|
+
var tm2 = ToLocalTime_1.ToLocalTime(y,
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });
|
|
37
|
+
var pattern = internalSlots.pattern, rangePatterns = internalSlots.rangePatterns;
|
|
38
|
+
var rangePattern;
|
|
39
|
+
var dateFieldsPracticallyEqual = true;
|
|
40
|
+
var patternContainsLargerDateField = false;
|
|
41
|
+
for (var _i = 0, TABLE_2_FIELDS_1 = TABLE_2_FIELDS; _i < TABLE_2_FIELDS_1.length; _i++) {
|
|
42
|
+
var fieldName = TABLE_2_FIELDS_1[_i];
|
|
43
|
+
if (dateFieldsPracticallyEqual && !patternContainsLargerDateField) {
|
|
44
|
+
if (fieldName === 'ampm') {
|
|
45
|
+
var v1 = tm1.hour;
|
|
46
|
+
var v2 = tm2.hour;
|
|
47
|
+
var rp = rangePatterns.ampm;
|
|
48
|
+
if ((v1 > 11 && v2 < 11) || (v1 < 11 && v2 > 11)) {
|
|
49
|
+
dateFieldsPracticallyEqual = false;
|
|
50
|
+
}
|
|
51
|
+
if (rangePattern !== undefined && rp === undefined) {
|
|
52
|
+
patternContainsLargerDateField = true;
|
|
53
|
+
}
|
|
54
|
+
rangePattern = rp;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
var v1 = tm1[fieldName];
|
|
58
|
+
var v2 = tm2[fieldName];
|
|
59
|
+
var rp = rangePatterns[fieldName];
|
|
60
|
+
if (!_262_1.SameValue(v1, v2)) {
|
|
61
|
+
dateFieldsPracticallyEqual = false;
|
|
62
|
+
}
|
|
63
|
+
if (rangePattern !== undefined && rp === undefined) {
|
|
64
|
+
patternContainsLargerDateField = true;
|
|
65
|
+
}
|
|
66
|
+
rangePattern = rp;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (dateFieldsPracticallyEqual) {
|
|
71
|
+
var result_2 = FormatDateTimePattern_1.FormatDateTimePattern(dtf, PartitionPattern_1.PartitionPattern(pattern), x, implDetails);
|
|
72
|
+
for (var _a = 0, result_1 = result_2; _a < result_1.length; _a++) {
|
|
73
|
+
var r = result_1[_a];
|
|
74
|
+
r.source = "shared" /* shared */;
|
|
75
|
+
}
|
|
76
|
+
return result_2;
|
|
77
|
+
}
|
|
78
|
+
var result = [];
|
|
79
|
+
if (rangePattern === undefined) {
|
|
80
|
+
rangePattern = rangePatterns.default;
|
|
81
|
+
}
|
|
82
|
+
for (var _b = 0, _c = rangePattern.patternParts; _b < _c.length; _b++) {
|
|
83
|
+
var rangePatternPart = _c[_b];
|
|
84
|
+
var source = rangePatternPart.source, pattern_1 = rangePatternPart.pattern;
|
|
85
|
+
var z = void 0;
|
|
86
|
+
if (source === "startRange" /* startRange */ ||
|
|
87
|
+
source === "shared" /* shared */) {
|
|
88
|
+
z = x;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
z = y;
|
|
92
|
+
}
|
|
93
|
+
var patternParts = PartitionPattern_1.PartitionPattern(pattern_1);
|
|
94
|
+
var partResult = FormatDateTimePattern_1.FormatDateTimePattern(dtf, patternParts, z, implDetails);
|
|
95
|
+
for (var _d = 0, partResult_1 = partResult; _d < partResult_1.length; _d++) {
|
|
96
|
+
var r = partResult_1[_d];
|
|
97
|
+
r.source = source;
|
|
98
|
+
}
|
|
99
|
+
result = result.concat(partResult);
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
exports.PartitionDateTimeRangePattern = PartitionDateTimeRangePattern;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToDateTimeOptions.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/ToDateTimeOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAGzD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI,EACtC,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,GAChB,qBAAqB,CAyDvB"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { UnpackedZoneData } from '
|
|
1
|
+
import { UnpackedZoneData } from '../types/date-time';
|
|
2
|
+
export interface ToLocalTimeImplDetails {
|
|
3
|
+
tzData: Record<string, UnpackedZoneData[]>;
|
|
4
|
+
}
|
|
2
5
|
/**
|
|
3
6
|
* https://tc39.es/ecma402/#sec-tolocaltime
|
|
4
7
|
* @param t
|
|
5
8
|
* @param calendar
|
|
6
9
|
* @param timeZone
|
|
7
10
|
*/
|
|
8
|
-
export declare function ToLocalTime(t: number, calendar: string, timeZone: string, { tzData }: {
|
|
9
|
-
tzData: Record<string, UnpackedZoneData[]>;
|
|
10
|
-
}): {
|
|
11
|
+
export declare function ToLocalTime(t: number, calendar: string, timeZone: string, { tzData }: ToLocalTimeImplDetails): {
|
|
11
12
|
weekday: number;
|
|
12
13
|
era: string;
|
|
13
14
|
year: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToLocalTime.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/ToLocalTime.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAkCpD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;CAC5C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,EAAC,MAAM,EAAC,EAAE,sBAAsB,GAC/B;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,SAAS,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACxB,CAyBA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ToLocalTime = void 0;
|
|
4
4
|
var utils_1 = require("../utils");
|
|
5
|
-
var _262_1 = require("
|
|
5
|
+
var _262_1 = require("../262");
|
|
6
6
|
function getApplicableZoneData(t, timeZone, tzData) {
|
|
7
7
|
var _a;
|
|
8
8
|
var zoneData = tzData[timeZone];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DateTimeFormatOptions, Formats, RangePatternPart } from '../types/date-time';
|
|
2
|
+
export declare function processDateTimePattern(pattern: string, result?: Pick<DateTimeFormatOptions, 'weekday' | 'era' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'timeZoneName'> & {
|
|
3
|
+
hour12?: boolean;
|
|
4
|
+
}): [string, string];
|
|
5
|
+
/**
|
|
6
|
+
* Parse Date time skeleton into Intl.DateTimeFormatOptions
|
|
7
|
+
* Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
8
|
+
* @public
|
|
9
|
+
* @param skeleton skeleton string
|
|
10
|
+
*/
|
|
11
|
+
export declare function parseDateTimeSkeleton(skeleton: string, rawPattern?: string, rangePatterns?: Record<string, string>, intervalFormatFallback?: string): Formats;
|
|
12
|
+
export declare function splitFallbackRangePattern(pattern: string): Array<RangePatternPart>;
|
|
13
|
+
export declare function splitRangePattern(pattern: string): Array<RangePatternPart>;
|
|
14
|
+
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,OAAO,EACP,gBAAgB,EAIjB,MAAM,oBAAoB,CAAC;AA+M5B,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,IAAI,CACX,qBAAqB,EACnB,SAAS,GACT,KAAK,GACL,MAAM,GACN,OAAO,GACP,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,cAAc,CACjB,GAAG;IACF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACA,CAAC,MAAM,EAAE,MAAM,CAAC,CA8BlB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,MAAiB,EAC7B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CA+CT;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,GACd,KAAK,CAAC,gBAAgB,CAAC,CAqBzB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAgC1E"}
|