@talend/utils
Advanced tools
Comparing version 2.3.0 to 2.4.0
# @talend/utils | ||
## 2.4.0 | ||
### Minor Changes | ||
- 4961b509d: feat(TDC-6345): add MD date formatter | ||
## 2.3.0 | ||
@@ -4,0 +10,0 @@ |
@@ -78,2 +78,4 @@ declare type DateFnsFormatInput = Date | number | string; | ||
MDY: string; | ||
/** en: 6/29 / fr: 29/06 / ja: 06/29 / de: 29.06 */ | ||
MD: 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 */ | ||
@@ -102,2 +104,4 @@ MDYHM: string; | ||
MDY: string; | ||
/** en: 6/29 / fr: 29/06 / ja: 06/29 / de: 29.06 */ | ||
MD: 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 */ | ||
@@ -104,0 +108,0 @@ MDYHM: string; |
@@ -203,2 +203,5 @@ "use strict"; | ||
/** en: 6/29 / fr: 29/06 / ja: 06/29 / de: 29.06 */ | ||
MD: 'MD', | ||
/** 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 */ | ||
@@ -223,2 +226,6 @@ MDYHM: 'MDYHM' | ||
}, | ||
[FORMAT.MD]: { | ||
month: 'numeric', | ||
day: 'numeric' | ||
}, | ||
[FORMAT.MDYHM]: { | ||
@@ -225,0 +232,0 @@ dateStyle: 'short', |
{ | ||
"name": "@talend/utils", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "Various utilities", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -262,3 +262,14 @@ import dateFnsFormat from 'date-fns/format'; | ||
}); | ||
it('should format date without year', () => { | ||
// given | ||
const dateObj = new Date('2020-05-13, 20:00'); | ||
// then | ||
expect(format(dateObj, FORMAT.MD, 'fr')).toEqual('13/05'); | ||
// and | ||
expect(format(dateObj, FORMAT.MD, 'en')).toEqual('5/13'); | ||
}); | ||
}); | ||
}); |
@@ -199,2 +199,4 @@ import dateFnsFormat from 'date-fns/format'; | ||
MDY: 'MDY', | ||
/** en: 6/29 / fr: 29/06 / ja: 06/29 / de: 29.06 */ | ||
MD: 'MD', | ||
/** 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 */ | ||
@@ -208,2 +210,3 @@ MDYHM: 'MDYHM', | ||
[FORMAT.MDY]: { year: 'numeric', month: '2-digit', day: '2-digit' }, | ||
[FORMAT.MD]: { month: 'numeric', day: 'numeric' }, | ||
[FORMAT.MDYHM]: { dateStyle: 'short', timeStyle: 'short' }, | ||
@@ -210,0 +213,0 @@ } as DateFormatOptions; |
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
65340
1132