@talend/utils
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -6,5 +6,2 @@ declare type DateFnsFormatInput = Date | number | string; | ||
} | ||
interface DateFormatOptions { | ||
[key: string]: Intl.DateTimeFormatOptions; | ||
} | ||
/** | ||
@@ -93,3 +90,12 @@ * Get the offset between a timezone and the UTC time (in minutes) | ||
format: typeof format; | ||
options: DateFormatOptions; | ||
FORMAT: { | ||
/** en: June 29, 2021 / fr: 29 juin 2020 / ja: 2020年6月29日 / de 29. Juni 2020 */ | ||
MDY_LONG: string; | ||
/** en: June 2020 / fr: juin 2020 / ja: 2020年6月 / Juni 2020 */ | ||
MY_LONG: string; | ||
/** en: 06/29/2020 / fr: 29/06/2020 / ja: 2020/06/29 / de: 29.06.2020 */ | ||
MDY: string; | ||
/** en: 6/29/20, 10:00 PM / fr: 29/06/2020 22:00 / ja: 2020/06/29 22:00 / de: 29.06.20, 22:00 */ | ||
MDYHM: string; | ||
}; | ||
formatReadableUTCOffset: typeof formatReadableUTCOffset; | ||
@@ -96,0 +102,0 @@ formatToTimeZone: typeof formatToTimeZone; |
@@ -202,3 +202,3 @@ "use strict"; | ||
format: format, | ||
options: options, | ||
FORMAT: exports.FORMAT, | ||
formatReadableUTCOffset: formatReadableUTCOffset, | ||
@@ -205,0 +205,0 @@ formatToTimeZone: formatToTimeZone, |
{ | ||
"name": "@talend/utils", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Various utilities", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -211,3 +211,3 @@ import dateFnsFormat from 'date-fns/format'; | ||
*/ | ||
export function format (date: DateFnsFormatInput, dateOption: string, lang: string): string { | ||
export function format(date: DateFnsFormatInput, dateOption: string, lang: string): string { | ||
return new Intl.DateTimeFormat(lang, options[dateOption]).format(parse(date)); | ||
@@ -221,3 +221,3 @@ }; | ||
format, | ||
options, | ||
FORMAT, | ||
formatReadableUTCOffset, | ||
@@ -224,0 +224,0 @@ formatToTimeZone, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49815
35
1101