@adyen/kyc-components
Version:
This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.
36 lines (35 loc) • 1.31 kB
JavaScript
try {
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "827362e5-0911-495e-a717-029b4372884a", e._sentryDebugIdIdentifier = "sentry-dbid-827362e5-0911-495e-a717-029b4372884a");
} catch (e) {}
import { o as createLogger } from "./translation-BFxyJ1c5.js";
//#region src/utils/localizeDateString.ts
/**
*
* @param dateString - A date in string format
* @param locale - A string depicting the locale
* @param options - DateTimeFormatOptions
* @returns A localized date
*
* @example
* localizeDateString('1970-01-01', 'en-US')
* // 'January 01, 1970'
* localizeDateString('1970-01-01', 'en-US', { month: 'short' })
* // 'Jan 01, 1970'
*/
var localizeDateString = (dateString, locale, options) => {
const logger = createLogger();
const formatOptions = {
timeZone: options?.timeZone ?? "UTC",
year: options?.year ?? "numeric",
month: options?.month ?? "long",
day: options?.day ?? "2-digit"
};
try {
return new Intl.DateTimeFormat(locale, formatOptions).format(new Date(dateString));
} catch (err) {
logger.error(err);
}
};
//#endregion
export { localizeDateString as t };