All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.components.VDatePicker.util.createNativeLocaleFormatter.mjs.map Maven / Gradle / Ivy

{"version":3,"file":"createNativeLocaleFormatter.mjs","names":["pad","createNativeLocaleFormatter","locale","options","substrOptions","arguments","length","undefined","start","makeIsoString","dateString","year","month","date","trim","split","join","intlFormatter","Intl","DateTimeFormat","format","Date","e","substr"],"sources":["../../../../src/components/VDatePicker/util/createNativeLocaleFormatter.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable */\n\nimport pad from './pad'\nimport { DatePickerFormatter } from 'vuetify/types'\n\ninterface SubstrOptions {\n  start?: number\n  length: number\n}\n\nfunction createNativeLocaleFormatter (\n  local: string | undefined,\n  options: Intl.DateTimeFormatOptions\n): DatePickerFormatter | undefined\n\nfunction createNativeLocaleFormatter (\n  local: string | undefined,\n  options: Intl.DateTimeFormatOptions,\n  substrOptions: SubstrOptions\n): DatePickerFormatter\n\nfunction createNativeLocaleFormatter (\n  locale: string | undefined,\n  options: Intl.DateTimeFormatOptions,\n  substrOptions: SubstrOptions = { start: 0, length: 0 }\n): DatePickerFormatter | undefined {\n  const makeIsoString = (dateString: string) => {\n    const [year, month, date] = dateString.trim().split(' ')[0].split('-')\n    return [pad(year, 4), pad(month || 1), pad(date || 1)].join('-')\n  }\n\n  try {\n    const intlFormatter = new Intl.DateTimeFormat(locale || undefined, options)\n    return (dateString: string) => intlFormatter.format(new Date(`${makeIsoString(dateString)}T00:00:00+00:00`))\n  } catch (e) {\n    return (substrOptions.start || substrOptions.length)\n      ? (dateString: string) => makeIsoString(dateString).substr(substrOptions.start || 0, substrOptions.length)\n      : undefined\n  }\n}\n\nexport default createNativeLocaleFormatter\n"],"mappings":"AAAA;AACA;AAAA,OAEOA,GAAG;AAmBV,SAASC,2BAA2BA,CAClCC,MAA0B,EAC1BC,OAAmC,EAEF;EAAA,IADjCC,aAA4B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAA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